@@ -83,7 +83,6 @@ class invariant_failedt: public std::logic_error
8383 const std::string &reason);
8484
8585 public:
86-
8786 const std::string file;
8887 const std::string function;
8988 const int line;
@@ -117,20 +116,24 @@ class invariant_failedt: public std::logic_error
117116#define INVARIANT (CONDITION, REASON ) \
118117 __CPROVER_assert ((CONDITION), "Invariant : " REASON)
119118
119+ #define INVARIANT_STRUCTURED (CONDITION, TYPENAME, ...) \
120+ INVARIANT (CONDITION, " " )
120121
121122#elif defined(CPROVER_INVARIANT_DO_NOT_CHECK)
122123// For performance builds, invariants can be ignored
123124// This is *not* recommended as it can result in unpredictable behaviour
124125// including silently reporting incorrect results.
125126// This is also useful for checking side-effect freedom.
126- #define INVARIANT (CONDITION, REASON, ...) do {} while (0 )
127+ #define INVARIANT (CONDITION, REASON ) do {} while (0 )
128+ #define INVARIANT_STRUCTURED (CONDITION, TYPENAME, ...) do {} while (0 )
127129
128130#elif defined(CPROVER_INVARIANT_ASSERT)
129131// Not recommended but provided for backwards compatability
130132#include < cassert>
131133// NOLINTNEXTLINE(*)
132- #define INVARIANT (CONDITION, REASON, ...) assert ((CONDITION) && ((REASON), true ))
133-
134+ #define INVARIANT (CONDITION, REASON ) assert ((CONDITION) && ((REASON), true ))
135+ // NOLINTNEXTLINE(*)
136+ #define INVARIANT_STRUCTURED (CONDITION, TYPENAME, ...) assert ((CONDITION))
134137#else
135138
136139void print_backtrace (std::ostream &out);
0 commit comments