[Bug c++/84414] miscompile due to assuming that object returned by value cannot alias its own member pointer values

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 16 00:29:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84414

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
To me, the temp object A inside Foo ends its scope at the end function (even
with guaranteed copy elision).

Because this would mean the compiler will have to assume nothing about any
structs that are returned which seems backwards and even counter to the
language itself.

Maybe it is time to file a DR to the C++ language folks about this case if
there is not one already.  Where does the scope of object A inside Foo begin
and end?


More information about the Gcc-bugs mailing list