diff options
| author | Caolán McNamara <caolanm@redhat.com> | 2014-07-06 15:34:41 +0100 |
|---|---|---|
| committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-06 15:34:45 +0100 |
| commit | 059fcd2878071616cedb5116a0b2f75b5edbdbe0 (patch) | |
| tree | 2b735ab5c20620011470be7a1b9748fcc5a0c9c3 /include/cppunit | |
| parent | 18a1369dbdb46c393f415c5a12bb9b5206cbb1c5 (diff) | |
| download | cppunit-059fcd2878071616cedb5116a0b2f75b5edbdbe0.tar.gz | |
mark the fails as no-return
that might help clang scan-build understand that execution won't continue after
they fail
Diffstat (limited to 'include/cppunit')
| -rw-r--r-- | include/cppunit/Asserter.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/cppunit/Asserter.h b/include/cppunit/Asserter.h index 94dadaa..ad981b5 100644 --- a/include/cppunit/Asserter.h +++ b/include/cppunit/Asserter.h @@ -42,17 +42,24 @@ class Message; * CPPUNIT_SOURCELINE() ) * \endcode */ + +#if defined __GNUC__ +# define NORETURN __attribute__((noreturn)) +#else +# define NORETURN +#endif + struct Asserter { /*! \brief Throws a Exception with the specified message and location. */ - static void CPPUNIT_API fail( const Message &message, + NORETURN static void CPPUNIT_API fail( const Message &message, const SourceLine &sourceLine = SourceLine() ); /*! \brief Throws a Exception with the specified message and location. * \deprecated Use fail( Message, SourceLine ) instead. */ - static void CPPUNIT_API fail( std::string message, + NORETURN static void CPPUNIT_API fail( std::string message, const SourceLine &sourceLine = SourceLine() ); /*! \brief Throws a Exception with the specified message and location. @@ -111,7 +118,7 @@ struct Asserter * what are the differences between the expected and actual value. * \param shortDescription Short description for the failure message. */ - static void CPPUNIT_API failNotEqual( std::string expected, + NORETURN static void CPPUNIT_API failNotEqual( std::string expected, std::string actual, const SourceLine &sourceLine, const AdditionalMessage &additionalMessage = AdditionalMessage(), |
