Skip to content

Commit 0677196

Browse files
committed
[C++] Make VisitType() fallback branch unreachable
1 parent bc0b858 commit 0677196

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cpp/src/arrow/visit_type_inline.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "arrow/extension_type.h"
2121
#include "arrow/type.h"
2222
#include "arrow/util/macros.h"
23+
#include "arrow/util/unreachable.h"
2324
#include "arrow/visitor_generate.h"
2425

2526
namespace arrow {
@@ -83,9 +84,8 @@ inline auto VisitType(const DataType& type, VISITOR&& visitor, ARGS&&... args)
8384
switch (type.id()) {
8485
ARROW_GENERATE_FOR_ALL_TYPES(TYPE_VISIT_INLINE);
8586
default:
86-
break;
87+
Unreachable("Type not implemented");
8788
}
88-
return std::forward<VISITOR>(visitor)(type, std::forward<ARGS>(args)...);
8989
}
9090

9191
#undef TYPE_VISIT_INLINE

0 commit comments

Comments
 (0)