exception (uncaught_exceptions): Add comment.
authorJonathan Wakely <jwakely@redhat.com>
Tue, 28 Apr 2015 12:07:40 +0000 (13:07 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 28 Apr 2015 12:07:40 +0000 (13:07 +0100)
* libsupc++/exception (uncaught_exceptions): Add comment. Reorder #if.
* testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc:
Use -std=gnu++1z. Check feature-test macro.

From-SVN: r222523

libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/exception
libstdc++-v3/testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc

index 7dfb96e40f8ac74852a93099c36ee14d07d1b06e..159362d412ac16e1eb373714291050ab2d087fe6 100644 (file)
@@ -1,5 +1,9 @@
 2015-04-28  Jonathan Wakely  <jwakely@redhat.com>
 
+       * libsupc++/exception (uncaught_exceptions): Add comment. Reorder #if.
+       * testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc:
+       Use -std=gnu++1z. Check feature-test macro.
+
        * include/std/type_traits (void_t): Add.
        * testsuite/20_util/void_t/1.cc: New.
 
index 069b33cd8dabf80d1817ce3943ed4acceeec1774..5571fd9ac476926ca2981225d80b91d8a36a9155 100644 (file)
@@ -126,8 +126,9 @@ namespace std
    */
   bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
 
-#if !defined(__STRICT_ANSI__) || __cplusplus > 201402L
+#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++98
 #define __cpp_lib_uncaught_exceptions 201411
+  /// The number of uncaught exceptions.
   int uncaught_exceptions() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
 #endif
 
index 001903e8b97631b952c199c1c5c36e171caa6e9b..c65da5fee76f40ecbeefc7ff4bcd59c855198556 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-options "-std=gnu++11" }
+// { dg-options "-std=gnu++1z" }
 
 #include <cassert>
 #include <exception>
 #include <testsuite_hooks.h>
 
+#ifndef __cpp_lib_uncaught_exceptions
+# error "Feature-test macro for uncaught_exceptions missing"
+#elif __cpp_lib_uncaught_exceptions != 201411
+# error "Feature-test macro for uncaught_exceptions has wrong value"
+#endif
+
 struct UncaughtVerifier
 {
   int expected_count_ = 0;