@@ -15,18 +15,13 @@ Author: Daniel Poetzl
1515#include "validation_mode.h"
1616
1717/// This macro takes a condition which denotes a well-formedness criterion on
18- // / goto programs, expressions, instructions, etc. When invoking the macro, a
19- // / variable named `vm` of type `const validation_modet` should be in scope. It
20- // / indicates whether DATA_INVARIANT() is used to check the condition, or if an
21- // / exception is thrown when the condition does not hold.
22- #define DATA_CHECK (condition, message ) \
18+ /// goto programs, expressions, instructions, etc. The first parameter should be
19+ /// of type `validate_modet` and indicates whether DATA_INVARIANT() is used to
20+ /// check the condition, or if an exception is thrown when the condition does
21+ /// not hold.
22+ #define DATA_CHECK (vm , condition , message ) \
2323 do \
2424 { \
25- static_assert ( \
26- std::is_same<decltype (vm), const validation_modet>::value, \
27- " when invoking the macro DATA_CHECK(), a variable named `vm` of type " \
28- " `const validation_modet` should be in scope which indicates the " \
29- " validation mode (see `validate.h`" ); \
3025 switch(vm) \
3126 { \
3227 case validation_modet::INVARIANT: \
@@ -39,14 +34,9 @@ Author: Daniel Poetzl
3934 } \
4035 } while(0)
4136
42- #define DATA_CHECK_WITH_DIAGNOSTICS (condition, message, ...) \
37+ #define DATA_CHECK_WITH_DIAGNOSTICS (vm , condition , message , ...) \
4338 do \
4439 { \
45- static_assert ( \
46- std::is_same<decltype (vm), const validation_modet>::value, \
47- " when invoking the macro DATA_CHECK_WITH_DIAGNOSTICS(), a variable " \
48- " named `vm` of type `const validation_modet` should be in scope which " \
49- " indicates the validation mode (see `validate.h`" ); \
5040 switch(vm) \
5141 { \
5242 case validation_modet::INVARIANT: \
0 commit comments