]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/81852 define feature-test macro for -fthreadsafe-statics
authorJonathan Wakely <jwakely@redhat.com>
Sun, 10 Sep 2017 09:05:31 +0000 (10:05 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Sun, 10 Sep 2017 09:05:31 +0000 (10:05 +0100)
gcc/c-family:

PR c++/81852
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_threadsafe_static_init.

gcc/testsuite:

PR c++/81852
* g++.dg/cpp1y/feat-cxx11.C: Check __cpp_threadsafe_static_init.
* g++.dg/cpp1y/feat-cxx14.C: Likewise.
* g++.dg/cpp1y/feat-cxx98.C: Likewise.
* g++.dg/cpp1y/feat-neg.C: Likewise.
* g++.dg/cpp1z/feat-cxx1z.C: Likewise.

From-SVN: r251947

gcc/c-family/ChangeLog
gcc/c-family/c-cppbuiltin.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C
gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C
gcc/testsuite/g++.dg/cpp1y/feat-cxx98.C
gcc/testsuite/g++.dg/cpp1y/feat-neg.C
gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C

index 00e61ac220a010643341933ea82f9cc77a68c3af..4025a03680ce288a9a34d53a49d9837a6d3ea208 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-10  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR c++/81852
+       * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_threadsafe_static_init.
+
 2017-07-04  Release Manager
 
        * GCC 6.4.0 released.
index 3d4587e6db626db4aad7a22ca8b4186bd5c37fc4..3ef9091595336ded4a8f6620493052671b52f9d8 100644 (file)
@@ -891,6 +891,8 @@ c_cpp_builtins (cpp_reader *pfile)
        cpp_define (pfile, "__cpp_transactional_memory=210500");
       if (flag_sized_deallocation)
        cpp_define (pfile, "__cpp_sized_deallocation=201309");
+      if (flag_threadsafe_statics)
+       cpp_define (pfile, "__cpp_threadsafe_static_init=200806");
     }
   /* Note that we define this for C as well, so that we know if
      __attribute__((cleanup)) will interface with EH.  */
index 5d7697c4e430bec5ac5f6f5f5f29110f9d04b1d8..ca8a75fa65551e98199ed25aa27490bca66385ff 100644 (file)
@@ -1,3 +1,12 @@
+2017-09-10  Jonathan Wakely  <jwakely@redhat.com>
+
+       PR c++/81852
+       * g++.dg/cpp1y/feat-cxx11.C: Check __cpp_threadsafe_static_init.
+       * g++.dg/cpp1y/feat-cxx14.C: Likewise.
+       * g++.dg/cpp1y/feat-cxx98.C: Likewise.
+       * g++.dg/cpp1y/feat-neg.C: Likewise.
+       * g++.dg/cpp1z/feat-cxx1z.C: Likewise.
+
 2017-09-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        Backport from mainline:
index 6928d6bcbd872dfbed41d953ff23b2e8a215f23f..174777a6c056da40bde6e9d94bb0b6c4f7b9dc70 100644 (file)
 #  error "__cpp_alias_templates != 200704"
 #endif
 
+#ifndef __cpp_threadsafe_static_init
+#  error "__cpp_threadsafe_static_init"
+#elif __cpp_threadsafe_static_init != 200806
+#  error "__cpp_threadsafe_static_init != 200806"
+#endif
+
 //  C++14 features allowed in C++11 in non-ANSI modes:
 
 #ifndef __cpp_binary_literals
index dc30a9b3cf849f9c9a84986fff2e2fb96a227e45..e778fd33c4186db5af7dc6263014b69d7f035bdd 100644 (file)
 #  error "__cpp_alias_templates != 200704"
 #endif
 
+#ifndef __cpp_threadsafe_static_init
+#  error "__cpp_threadsafe_static_init"
+#elif __cpp_threadsafe_static_init != 200806
+#  error "__cpp_threadsafe_static_init != 200806"
+#endif
+
 //  C++14 features:
 
 #ifndef __cpp_binary_literals
index d15e7aadcee1118e4bc0dac471f07803b2a7003f..4db499cc2f4688dd1bf7de23620e004cfd4314ca 100644 (file)
 #  error "__cpp_exceptions != 199711"
 #endif
 
+//  C++11 features allowed in C++98:
+
+#ifndef __cpp_threadsafe_static_init
+#  error "__cpp_threadsafe_static_init"
+#elif __cpp_threadsafe_static_init != 200806
+#  error "__cpp_threadsafe_static_init != 200806"
+#endif
+
 //  C++14 features allowed in C++98 in non-ANSI modes:
 
 #ifndef __cpp_binary_literals
index 9f4a0412403984dade8d47bc4ffdaa6ddeac3dfb..5e95418dfe48bd968df1c40d0152bd7fb54db3a3 100644 (file)
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-fno-rtti -fno-exceptions" }
+// { dg-options "-fno-rtti -fno-exceptions -fno-threadsafe-statics" }
 
 //  C++98 features with explicit opt-out:
 
@@ -10,3 +10,9 @@
 #ifndef __cpp_exceptions
 #  error "__cpp_exceptions" // { dg-error "error" }
 #endif
+
+//  C++11 features with explicit opt-out:
+
+#ifndef __cpp_threadsafe_static_init
+#  error "__cpp_threadsafe_static_init" // { dg-error "error" }
+#endif
index 4a036d48fd99da4be15865e262a434fc1fdb4e0b..a8934ca2d19c15e00f23a482799eefa8c69a2d18 100644 (file)
 #  error "__cpp_alias_templates != 200704"
 #endif
 
+#ifndef __cpp_threadsafe_static_init
+#  error "__cpp_threadsafe_static_init"
+#elif __cpp_threadsafe_static_init != 200806
+#  error "__cpp_threadsafe_static_init != 200806"
+#endif
+
 //  C++14 features:
 
 #ifndef __cpp_binary_literals