[Bug c++/110195] defaulted constructor does not respect the private accessor

2023-06-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110195 --- Comment #8 from Jonathan Wakely --- In the context of the C++ standard a "defect report" has a very specific meaning, and it doesn't apply here. The proposal https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1008r1.pdf changed this

[Bug c++/110195] defaulted constructor does not respect the private accessor

2023-06-09 Thread jack.cui2 at foxmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110195 --- Comment #7 from jack --- (In reply to Jonathan Wakely from comment #6) > The standard. > In C++17 Single is an aggregate, and Single{} is aggregate-initialization, > which initializes each member in turn, without calling a constructor. Sinc

[Bug c++/110195] defaulted constructor does not respect the private accessor

2023-06-09 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110195 Jonathan Wakely changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRME

[Bug c++/110195] defaulted constructor does not respect the private accessor

2023-06-09 Thread jack.cui2 at foxmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110195 --- Comment #5 from jack --- (In reply to Andrew Pinski from comment #4) > Note clang accepts Single{} where Single is an empty class also before C++20 > ... I think Clang accepting empty class case does not neccessarily mean it is correct. Bec

[Bug c++/110195] defaulted constructor does not respect the private accessor

2023-06-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110195 --- Comment #4 from Andrew Pinski --- Note clang accepts Single{} where Single is an empty class also before C++20 ...

[Bug c++/110195] defaulted constructor does not respect the private accessor

2023-06-09 Thread jack.cui2 at foxmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110195 jack changed: What|Removed |Added Resolution|INVALID |--- Status|RESOLVED

[Bug c++/110195] defaulted constructor does not respect the private accessor

2023-06-09 Thread jack.cui2 at foxmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110195 --- Comment #2 from jack --- (In reply to Andrew Pinski from comment #1) > Before C++20, Single{} didn't call the constructor so this behavior is > expected. Could you explain why it didn't call the constructor before c++20? C++ standard rules

[Bug c++/110195] defaulted constructor does not respect the private accessor

2023-06-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110195 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---