@@ -142,11 +142,6 @@ class invariant_with_diagnostics_failedt : public invariant_failedt
142
142
#else
143
143
#define CBMC_NORETURN
144
144
#endif
145
- // The macros MACRO<n> (e.g., INVARIANT2) are for internal use in this file
146
- // only. The corresponding macros that take a variable number of arguments (see
147
- // further below) should be used instead, which in turn call those with a fixed
148
- // number of arguments. For example, if INVARIANT(...) is called with two
149
- // arguments, it calls INVARIANT2().
150
145
151
146
#if defined(CPROVER_INVARIANT_CPROVER_ASSERT)
152
147
// Used to allow CPROVER to check itself
@@ -321,17 +316,17 @@ inline void write_rest_diagnostics(std::ostream &)
321
316
template <typename T, typename ... Ts>
322
317
void write_rest_diagnostics (std::ostream &out, T &&next, Ts &&... rest)
323
318
{
324
- out << " , " << diagnostic_as_string (std::forward<T>(next));
319
+ out << " \n " << diagnostic_as_string (std::forward<T>(next));
325
320
write_rest_diagnostics (out, std::forward<Ts>(rest)...);
326
321
}
327
322
328
- template <typename T, typename ... Ts >
329
- std::string assemble_diagnostics (T &&first, Ts && ... rest )
323
+ template <typename ... Diagnostics >
324
+ std::string assemble_diagnostics (Diagnostics &&... args )
330
325
{
331
326
std::ostringstream out;
332
- out << " [ " << diagnostic_as_string (std::forward<T>(first)) ;
333
- write_rest_diagnostics (out, std::forward<Ts>(rest )...);
334
- out << " ] " ;
327
+ out << " \n << EXTRA DIAGNOSTICS >> " ;
328
+ write_rest_diagnostics (out, std::forward<Diagnostics>(args )...);
329
+ out << " \n << END EXTRA DIAGNOSTICS >> " ;
335
330
return out.str ();
336
331
}
337
332
} // namespace detail
@@ -457,18 +452,14 @@ CBMC_NORETURN void report_invariant_failure(
457
452
#define CHECK_RETURN_STRUCTURED (CONDITION, TYPENAME, ...) \
458
453
EXPAND_MACRO (INVARIANT_STRUCTURED(CONDITION, TYPENAME, __VA_ARGS__))
459
454
460
- // This should be used to mark dead code
455
+ // / This should be used to mark dead code
461
456
#define UNREACHABLE INVARIANT (false , " Unreachable" )
462
457
#define UNREACHABLE_STRUCTURED (TYPENAME, ...) \
463
458
EXPAND_MACRO (INVARIANT_STRUCTURED(false , TYPENAME, __VA_ARGS__))
464
459
465
- // This condition should be used to document that assumptions that are
466
- // made on goto_functions, goto_programs, exprts, etc. being well formed.
467
- // "The data structure is not corrupt or malformed"
468
- #define DATA_INVARIANT2 (CONDITION, REASON ) INVARIANT2(CONDITION, REASON)
469
- #define DATA_INVARIANT3 (CONDITION, REASON, DIAGNOSTICS ) \
470
- INVARIANT3 (CONDITION, REASON, DIAGNOSTICS)
471
-
460
+ // / This condition should be used to document that assumptions that are
461
+ // / made on goto_functions, goto_programs, exprts, etc. being well formed.
462
+ // / "The data structure is not corrupt or malformed"
472
463
#define DATA_INVARIANT (CONDITION, REASON ) INVARIANT(CONDITION, REASON)
473
464
#define DATA_INVARIANT_WITH_DIAGNOSTICS (CONDITION, REASON, ...) \
474
465
INVARIANT_WITH_DIAGNOSTICS (CONDITION, REASON, __VA_ARGS__)
@@ -482,6 +473,6 @@ CBMC_NORETURN void report_invariant_failure(
482
473
// to migrate documentation and "error handling" in older code.
483
474
#define TODO INVARIANT (false , " Todo" )
484
475
#define UNIMPLEMENTED INVARIANT (false , " Unimplemented" )
485
- #define UNHANDLED_CASE INVARIANT2 (false , " Unhandled case" )
476
+ #define UNHANDLED_CASE INVARIANT (false , " Unhandled case" )
486
477
487
478
#endif // CPROVER_UTIL_INVARIANT_H
0 commit comments