[Libreoffice-commits] cppunit.git: include/cppunit

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 13 09:28:19 UTC 2019


 include/cppunit/Asserter.h |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

New commits:
commit 3788fccdd12ea1e3240d79e85d9146f6c264c6ec
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Feb 1 13:37:59 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Feb 13 10:28:02 2019 +0100

    Unconditionally use C++11 [[noreturn]]
    
    This helps avoid issues like <https://gerrit.libreoffice.org/plugins/gitiles/
    core/+/9808486a89c6368f836579f8d8c0dda63fd0063c%5E%21> "Avoid
    -Werror,-Wimplicit-fallthrough with clang-cl ...where CPPUNIT_FAIL is marked as
    noreturn only for __GNUC__".
    
    Change-Id: Idb33af7375f103f2dd7a7b4c3dbf20ce731b17ad
    Reviewed-on: https://gerrit.libreoffice.org/67247
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/cppunit/Asserter.h b/include/cppunit/Asserter.h
index 3321b87..dd39ead 100644
--- a/include/cppunit/Asserter.h
+++ b/include/cppunit/Asserter.h
@@ -43,23 +43,17 @@ class Message;
  * \endcode
  */
 
-#if defined __GNUC__
-#   define NORETURN __attribute__((noreturn))
-#else
-#   define NORETURN
-#endif
-
 struct Asserter
 {
   /*! \brief Throws a Exception with the specified message and location.
    */
-  NORETURN 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.
    */
-  NORETURN 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.
@@ -165,7 +159,7 @@ struct Asserter
    *                          what are the differences between the expected and actual value.
    * \param shortDescription Short description for the failure message.
    */
-  NORETURN 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(),


More information about the Libreoffice-commits mailing list