https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
--- Comment #10 from Jakub Jelinek ---
One can't take __has_cpp_attribute support for granted, so perhaps that needs
to be wrapped inside ifdef.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
--- Comment #9 from Jonathan Wakely ---
Oops, the second #if should be #elif
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
--- Comment #8 from Jonathan Wakely ---
libstdc++ sources do this:
#if __has_cpp_attribute(clang::require_constant_initialization)
# define __constinit [[clang::require_constant_initialization]]
#endif
An alternative that doesn't use reserved
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
--- Comment #7 from Marc Mutz ---
Fantastic! Thanks for the tip!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #6
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
Marc Mutz changed:
What|Removed |Added
CC||marc.mutz at hotmail dot com
--- Comment #5
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
Jonathan Wakely changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
--- Comment #3 from Marek Polacek ---
I think this is now "superseded" by PR91360, C++20 constinit.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
--- Comment #2 from Jonathan Wakely ---
No because that also makes it const, i.e. immutable.
It's useful for non-const globals.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974
--- Comment #1 from Richard Biener ---
Hmm, can't the thing be just marked constexpr?
10 matches
Mail list logo