[Bug c++/107531] List of references calls destructors, add warning?

2022-11-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107531 --- Comment #5 from Jonathan Wakely --- Unsurprisingly, -fanalyzer doesn't say anything useful about this, because it doesn't support C++. PR 94355 tracks some of that (and the meta-bug that it blocks tracks more).

[Bug c++/107531] List of references calls destructors, add warning?

2022-11-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107531 --- Comment #4 from Jonathan Wakely --- (In reply to nightstrike from comment #0) > Maybe adding something from -fsanitize=undefined would be an option? There's nothing undefined in your example. But if you actually allocate and free resources

[Bug c++/107531] List of references calls destructors, add warning?

2022-11-05 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107531 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/107531] List of references calls destructors, add warning?

2022-11-04 Thread nightstrike at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107531 --- Comment #2 from nightstrike --- It looks like you're right. The root cause of the problem is that in my non-reduced case, I didn't have a copy constructor, but I had a non-default destructor that was releasing resources twice. So it's clea

[Bug c++/107531] List of references calls destructors, add warning?

2022-11-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107531 --- Comment #1 from Andrew Pinski --- My bet is on a copy constructor being invoked.