Skip to content

Commit afdc61c

Browse files
committed
Fix build on old gcc
1 parent 3e4d827 commit afdc61c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/from_current.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,12 @@ namespace detail {
571571
void** type_info_vtable_pointer = *static_cast<void***>(type_info_pointer);
572572
// the type info vtable pointer points to two pointers inside the vtable, adjust it back
573573
type_info_vtable_pointer -= 2;
574-
auto* can_catch_fn = reinterpret_cast<decltype(can_catch)*>(type_info_vtable_pointer[6]);
574+
auto* can_catch_fn =
575+
#if IS_GCC
576+
// error: ISO C++ forbids casting between pointer-to-function and pointer-to-object on old gcc
577+
__extension__
578+
#endif
579+
reinterpret_cast<decltype(can_catch)*>(type_info_vtable_pointer[6]);
575580
return can_catch_fn(type, throw_type, throw_obj, outer);
576581
}
577582
#endif

0 commit comments

Comments
 (0)