[Bug c++/113021] [constexpr] gcc rejects initializing struct containing vector during constant evaluation depending if the struct also contains other member

2023-12-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113021 --- Comment #4 from Andrew Pinski --- Looks like it is the uninitialized field pointer which is causing the issues. Looks like GCC does not currently fully support that for const variables inside a constexpr/consteval . The linked PRs are about

[Bug c++/113021] [constexpr] gcc rejects initializing struct containing vector during constant evaluation depending if the struct also contains other member

2023-12-15 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113021 --- Comment #3 from Miro Palmu --- Here is even more reduced. Notice that if the unused data member `pointer` is removed from `vec` the problem goes away. Same with data member `a` in struct `A`. ``` struct vec { int data; int*

[Bug c++/113021] [constexpr] gcc rejects initializing struct containing vector during constant evaluation depending if the struct also contains other member

2023-12-15 Thread miro.palmu at helsinki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113021 --- Comment #2 from Miro Palmu --- (In reply to Andrew Pinski from comment #1) > Confirmed. We should reduce this to remove the include file too ... Here is somewhat reduced: ``` #include auto alloc = std::allocator{}; constexpr auto n = 3;

[Bug c++/113021] [constexpr] gcc rejects initializing struct containing vector during constant evaluation depending if the struct also contains other member

2023-12-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113021 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|