[Bug c++/104266] Temporaries with protected destructor are erroneously permitted

2022-01-29 Thread fchelnokov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104266 --- Comment #4 from Fedor Chelnokov --- In your last example, I think Clang is right, because `Y` is not an aggregate in C++11 due to the presence of default member initializer. And it becomes an aggregate only in C++14.

[Bug c++/104266] Temporaries with protected destructor are erroneously permitted

2022-01-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104266 --- Comment #3 from Andrew Pinski --- Here is another example: class X { protected: ~X(); friend struct Y; }; struct Y { X x = {}; }; int main() { Y b {}; } But unlike the previous example, this one is rejected by clang in C++14 bu

[Bug c++/104266] Temporaries with protected destructor are erroneously permitted

2022-01-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104266 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0

[Bug c++/104266] Temporaries with protected destructor are erroneously permitted

2022-01-28 Thread de34 at live dot cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104266 Jiang An changed: What|Removed |Added CC||de34 at live dot cn --- Comment #1 from Jian