[libcxx] r273819 - Add [[noreturn]] attribute to throw_bad_alloc_helper().

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 26 12:43:00 PDT 2016


Author: ericwf
Date: Sun Jun 26 14:42:59 2016
New Revision: 273819

URL: http://llvm.org/viewvc/llvm-project?rev=273819&view=rev
Log:
Add [[noreturn]] attribute to throw_bad_alloc_helper().

Modified:
    libcxx/trunk/test/support/count_new.hpp
    libcxx/trunk/test/support/test_macros.h

Modified: libcxx/trunk/test/support/count_new.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/count_new.hpp?rev=273819&r1=273818&r2=273819&view=diff
==============================================================================
--- libcxx/trunk/test/support/count_new.hpp (original)
+++ libcxx/trunk/test/support/count_new.hpp Sun Jun 26 14:42:59 2016
@@ -16,14 +16,13 @@
 
 #include "test_macros.h"
 
-#if  TEST_HAS_FEATURE(address_sanitizer) \
-  || TEST_HAS_FEATURE(memory_sanitizer) \
-  || TEST_HAS_FEATURE(thread_sanitizer)
+#if defined(TEST_HAS_SANITIZERS)
 #define DISABLE_NEW_COUNT
 #endif
 
 namespace detail
 {
+   TEST_NORETURN
    inline void throw_bad_alloc_helper() {
 #ifndef TEST_HAS_NO_EXCEPTIONS
        throw std::bad_alloc();

Modified: libcxx/trunk/test/support/test_macros.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_macros.h?rev=273819&r1=273818&r2=273819&view=diff
==============================================================================
--- libcxx/trunk/test/support/test_macros.h (original)
+++ libcxx/trunk/test/support/test_macros.h Sun Jun 26 14:42:59 2016
@@ -86,6 +86,12 @@
 #define TEST_HAS_SANITIZERS
 #endif
 
+#if defined(_LIBCPP_NORETURN)
+#define TEST_NORETURN _LIBCPP_NORETURN
+#else
+#define TEST_NORETURN [[noreturn]]
+#endif
+
 /* Macros for testing libc++ specific behavior and extensions */
 #if defined(_LIBCPP_VERSION)
 #define LIBCPP_ASSERT(...) assert(__VA_ARGS__)




More information about the cfe-commits mailing list