https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99001
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Wolfgang Roehrl from comment #0) > Hi, > I would like to post a bug report for the GNU C/C++ compiler 7.5.0. GCC 7 is no longer supported or maintained and will not get any bug fixes. > I think that the behaviour of f2() is wrong and f2() should behave as > function f1() does. No, what GCC does is correct. In f2 the return value is initialized before x.~X() runs.