From: Jonathan Wakely Date: Tue, 28 Apr 2015 12:07:40 +0000 (+0100) Subject: exception (uncaught_exceptions): Add comment. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=196e0493cbb815694372c520cfb9150cad60d799;p=gcc.git exception (uncaught_exceptions): Add comment. * 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7dfb96e40f8..159362d412a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2015-04-28 Jonathan Wakely + * 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. diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception index 069b33cd8da..5571fd9ac47 100644 --- a/libstdc++-v3/libsupc++/exception +++ b/libstdc++-v3/libsupc++/exception @@ -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 diff --git a/libstdc++-v3/testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc b/libstdc++-v3/testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc index 001903e8b97..c65da5fee76 100644 --- a/libstdc++-v3/testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc +++ b/libstdc++-v3/testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc @@ -15,12 +15,18 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=gnu++11" } +// { dg-options "-std=gnu++1z" } #include #include #include +#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;