https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83384
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2017-12-12 Component|c++ |middle-end Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- There are kind-of duplicates of this bug, at least related ones. First eliding new/delete (you are leaking i btw), second eliding heap allocation with stack allocation.