[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 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 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] New: 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 Bug ID: 110195 Summary: defaulted constructor does not respect the private accessor Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal

[Bug c++/105265] temporary object not destructed causing memory leaks

2022-04-13 Thread jack.cui2 at foxmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105265 --- Comment #2 from jack --- Additional info: g++8.4 and clang++ 3.8 have no such issue

[Bug c++/105265] temporary object not destructed causing memory leaks

2022-04-13 Thread jack.cui2 at foxmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105265 --- Comment #1 from jack --- #include using namespace std; class Block { public: Block(int n) : data{new char[n]}, size{n} { cout << "Block ctor\n"; } ~Block() { cout << "Block dtor\n"; delete[] da

[Bug c++/105265] New: temporary object not destructed causing memory leaks

2022-04-13 Thread jack.cui2 at foxmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105265 Bug ID: 105265 Summary: temporary object not destructed causing memory leaks Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Comp

[Bug c++/103790] New: internal compiler error: Segmentation fault when playing with coroutine

2021-12-21 Thread jack.cui2 at foxmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103790 Bug ID: 103790 Summary: internal compiler error: Segmentation fault when playing with coroutine Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: norm