Skip to content

Commit da127a5

Browse files
author
Enrico Steffinlongo
committed
Generated new version of UNIMPLEMENTED_FEATURE addressing error on GCC 12
1 parent 273fff5 commit da127a5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/util/invariant.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,17 @@ CBMC_NORETURN void report_invariant_failure(
529529
#define DATA_INVARIANT_STRUCTURED(CONDITION, TYPENAME, ...) \
530530
EXPAND_MACRO(INVARIANT_STRUCTURED(CONDITION, TYPENAME, __VA_ARGS__))
531531

532-
#define UNIMPLEMENTED_FEATURE(FEATURE) \
533-
INVARIANT(false, std::string{"Reached unimplemented "} + (FEATURE))
532+
#if __GNUC__
533+
# define UNIMPLEMENTED_FEATURE(FEATURE) \
534+
do \
535+
{ \
536+
INVARIANT(false, std::string{"Reached unimplemented "} + (FEATURE)); \
537+
__builtin_unreachable(); \
538+
} while(false)
539+
#else
540+
# define UNIMPLEMENTED_FEATURE(FEATURE) \
541+
INVARIANT(false, std::string{"Reached unimplemented "} + (FEATURE))
542+
#endif
534543

535544
// Legacy annotations
536545

0 commit comments

Comments
 (0)