[Bug c++/86974] Support Clang's require_constant_initialization attribute

2022-03-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
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.

[Bug c++/86974] Support Clang's require_constant_initialization attribute

2022-03-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974 --- Comment #9 from Jonathan Wakely --- Oops, the second #if should be #elif

[Bug c++/86974] Support Clang's require_constant_initialization attribute

2022-03-16 Thread redi at gcc dot gnu.org via Gcc-bugs
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

[Bug c++/86974] Support Clang's require_constant_initialization attribute

2022-03-16 Thread marc.mutz at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974 --- Comment #7 from Marc Mutz --- Fantastic! Thanks for the tip!

[Bug c++/86974] Support Clang's require_constant_initialization attribute

2022-03-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
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

[Bug c++/86974] Support Clang's require_constant_initialization attribute

2022-03-16 Thread marc.mutz at hotmail dot com via Gcc-bugs
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

[Bug c++/86974] Support Clang's require_constant_initialization attribute

2019-08-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/86974] Support Clang's require_constant_initialization attribute

2019-08-07 Thread mpolacek at gcc dot gnu.org
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.

[Bug c++/86974] Support Clang's require_constant_initialization attribute

2018-08-22 Thread redi at gcc dot gnu.org
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.

[Bug c++/86974] Support Clang's require_constant_initialization attribute

2018-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86974 --- Comment #1 from Richard Biener --- Hmm, can't the thing be just marked constexpr?