|
75 | 75 | class invariant_failedt
|
76 | 76 | {
|
77 | 77 | private:
|
78 |
| - std::string get_invariant_failed_message( |
79 |
| - const std::string &file, |
80 |
| - const std::string &function, |
81 |
| - int line, |
82 |
| - const std::string &backtrace, |
83 |
| - const std::string &reason) const; |
84 |
| - |
85 |
| - public: |
86 | 78 | const std::string file;
|
87 | 79 | const std::string function;
|
88 | 80 | const int line;
|
89 | 81 | const std::string backtrace;
|
90 |
| - const std::string reason; |
91 | 82 | const std::string condition;
|
| 83 | + const std::string reason; |
92 | 84 |
|
93 |
| - std::string what() const noexcept |
94 |
| - { |
95 |
| - return get_invariant_failed_message( |
96 |
| - file, function, line, backtrace, reason); |
97 |
| - }; |
| 85 | +public: |
| 86 | + std::string what() const noexcept; |
98 | 87 |
|
99 | 88 | invariant_failedt(
|
100 | 89 | const std::string &_file,
|
101 | 90 | const std::string &_function,
|
102 | 91 | int _line,
|
103 | 92 | const std::string &_backtrace,
|
104 |
| - const std::string &_reason, |
105 |
| - const std::string &_condition) |
| 93 | + const std::string &_condition, |
| 94 | + const std::string &_reason) |
106 | 95 | : file(_file),
|
107 | 96 | function(_function),
|
108 | 97 | line(_line),
|
109 | 98 | backtrace(_backtrace),
|
110 |
| - reason(_reason), |
111 |
| - condition(_condition) |
| 99 | + condition(_condition), |
| 100 | + reason(_reason) |
112 | 101 | {
|
113 | 102 | }
|
114 | 103 | };
|
@@ -171,8 +160,8 @@ invariant_violated_structured(
|
171 | 160 | function,
|
172 | 161 | line,
|
173 | 162 | backtrace,
|
174 |
| - std::forward<Params>(params)..., |
175 |
| - condition); |
| 163 | + condition, |
| 164 | + std::forward<Params>(params)...); |
176 | 165 | // We now have a structured exception ready to use;
|
177 | 166 | // in future this is the place to put a 'throw'.
|
178 | 167 | report_exception_to_stderr(to_throw);
|
@@ -230,8 +219,8 @@ invariant_violated_string(
|
230 | 219 | __FILE__, \
|
231 | 220 | __this_function__, \
|
232 | 221 | __LINE__, \
|
233 |
| - __VA_ARGS__, \ |
234 |
| - #CONDITION); /* NOLINT */ \ |
| 222 | + #CONDITION, \ |
| 223 | + __VA_ARGS__); /* NOLINT */ \ |
235 | 224 | } while(false)
|
236 | 225 |
|
237 | 226 | #endif // End CPROVER_DO_NOT_CHECK / CPROVER_ASSERT / ... if block
|
|
0 commit comments