[Bug c++/103843] Direct call to Desctructor is optimized out

2021-12-27 Thread georgii.shagov--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103843 Georgii.Shagov changed: What|Removed |Added Resolution|INVALID |FIXED --- Comment #5 from Georgii.Shag

[Bug c++/103843] Direct call to Desctructor is optimized out

2021-12-27 Thread georgii.shagov--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103843 Georgii.Shagov changed: What|Removed |Added Resolution|INVALID |FIXED --- Comment #3 from Georgii.Shag

[Bug c++/103843] Direct call to Desctructor is optimized out

2021-12-27 Thread georgii.shagov--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103843 --- Comment #1 from Georgii.Shagov --- >From experiments, I would guess that in case of -O3 the call to destructor was substituted by initializer: This works fine: cat ./d.cpp #include class S { public: S() : i{1} {} ~S() { i=0; } v

[Bug c++/103843] New: Direct call to Desctructor is optimized out

2021-12-27 Thread georgii.shagov--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103843 Bug ID: 103843 Summary: Direct call to Desctructor is optimized out Product: gcc Version: 10.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c+