From: Jonathan Wakely Date: Mon, 2 Sep 2019 11:31:34 +0000 (+0100) Subject: Use __constinit keyword in libstdc++ sources X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d2faf10f9578b16d8c262d5d8d307f5bfe3ee2bf;p=gcc.git Use __constinit keyword in libstdc++ sources * src/c++17/memory_resource.cc: Use __constinit keyword. From-SVN: r275315 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 583e4a986b0..bca28e670b9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2019-09-02 Jonathan Wakely + + * src/c++17/memory_resource.cc: Use __constinit keyword. + 2019-09-02 Jonathan Wakely * doc/xml/manual/abi.xml: Document 9.x library versions. diff --git a/libstdc++-v3/src/c++17/memory_resource.cc b/libstdc++-v3/src/c++17/memory_resource.cc index b6698011f5c..2b64039d280 100644 --- a/libstdc++-v3/src/c++17/memory_resource.cc +++ b/libstdc++-v3/src/c++17/memory_resource.cc @@ -85,8 +85,8 @@ namespace pmr ~constant_init() { /* do nothing, union member is not destroyed */ } }; - constant_init newdel_res{}; - constant_init null_res{}; + __constinit constant_init newdel_res{}; + __constinit constant_init null_res{}; #if ATOMIC_POINTER_LOCK_FREE == 2 using atomic_mem_res = atomic; # 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 default_res{&newdel_res.obj}; + __constinit constant_init default_res{&newdel_res.obj}; #else # include "default_resource.h" #endif