Skip to content

Commit 393256f

Browse files
author
Daniel Kroening
committed
invariant_violated does not return
1 parent 439ef97 commit 393256f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util/invariant.h

+6
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ void report_exception_to_stderr(const invariant_failedt &);
149149
/// \param params : (variadic) parameters to forward to ET's constructor
150150
/// its backtrace member will be set before it is used.
151151
template<class ET, typename ...Params>
152+
#ifdef __GNUC__
153+
__attribute__((noreturn))
154+
#endif
152155
typename std::enable_if<std::is_base_of<invariant_failedt, ET>::value>::type
153156
invariant_violated_structured(
154157
const std::string &file,
@@ -171,6 +174,9 @@ invariant_violated_structured(
171174
/// \param function : C string giving the name of the function.
172175
/// \param line : The line number of the invariant
173176
/// \param reason : brief description of the invariant violation.
177+
#ifdef __GNUC__
178+
__attribute__((noreturn))
179+
#endif
174180
inline void invariant_violated_string(
175181
const std::string &file,
176182
const std::string &function,

0 commit comments

Comments
 (0)