[Bug c++/101442] Destructor not called for a temporary object, if it's bound to a ref member of an object subject to NRVO

2021-07-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101442 Richard Biener changed: What|Removed |Added Last reconfirmed||2021-07-14 Version|unknown

[Bug c++/101442] Destructor not called for a temporary object, if it's bound to a ref member of an object subject to NRVO

2021-07-13 Thread iamsupermouse at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101442 --- Comment #1 from Egor --- Example is provided below. It prints `A()` and nothing else. I expected it to also pring `~A()`. ``` #include struct A { A() {std::cout << "A()\n";} A(const A &) = delete; A &operator=(const A &) = del