]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use __constinit keyword in libstdc++ sources
authorJonathan Wakely <jwakely@redhat.com>
Mon, 2 Sep 2019 11:31:34 +0000 (12:31 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 2 Sep 2019 11:31:34 +0000 (12:31 +0100)
* src/c++17/memory_resource.cc: Use __constinit keyword.

From-SVN: r275315

libstdc++-v3/ChangeLog
libstdc++-v3/src/c++17/memory_resource.cc

index 583e4a986b0fac3d796404cab55e340326ddc34b..bca28e670b99faaf523fd5c473bbbe7e1835d903 100644 (file)
@@ -1,3 +1,7 @@
+2019-09-02  Jonathan Wakely  <jwakely@redhat.com>
+
+       * src/c++17/memory_resource.cc: Use __constinit keyword.
+
 2019-09-02  Jonathan Wakely  <jwakely@redhat.com>
 
        * doc/xml/manual/abi.xml: Document 9.x library versions.
index b6698011f5cdec8bef88f338b51f332df5763ddf..2b64039d280c626daa840e863752da25ddc4de62 100644 (file)
@@ -85,8 +85,8 @@ namespace pmr
        ~constant_init() { /* do nothing, union member is not destroyed */ }
       };
 
-    constant_init<newdel_res_t> newdel_res{};
-    constant_init<null_res_t> null_res{};
+    __constinit constant_init<newdel_res_t> newdel_res{};
+    __constinit constant_init<null_res_t> null_res{};
 #if ATOMIC_POINTER_LOCK_FREE == 2
     using atomic_mem_res = atomic<memory_resource*>;
 # define _GLIBCXX_ATOMIC_MEM_RES_CAN_BE_CONSTANT_INITIALIZED
@@ -139,7 +139,7 @@ namespace pmr
 #endif // ATOMIC_POINTER_LOCK_FREE == 2
 
 #ifdef _GLIBCXX_ATOMIC_MEM_RES_CAN_BE_CONSTANT_INITIALIZED
-    constant_init<atomic_mem_res> default_res{&newdel_res.obj};
+    __constinit constant_init<atomic_mem_res> default_res{&newdel_res.obj};
 #else
 # include "default_resource.h"
 #endif