[Bug c++/95977] No deallocation of temporary in return-statement during constant evaluation
johelegp at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jun 29 21:39:24 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95977
--- Comment #1 from Johel Ernesto Guerrero Peña <johelegp at gmail dot com> ---
Slightly simplified: https://godbolt.org/z/9unpTF.
```C++
struct X {
int* x{new int{42}};
constexpr ~X() { delete x; }
};
constexpr int f() { return *X{}.x; }
constexpr int z{f()};
```
More information about the Gcc-bugs
mailing list