[Bug c++/98675] Accessing member of temporary outside its lifetime allowed in constexpr function

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 31 04:43:06 GMT 2022


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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Tobias Schlüter from comment #3)
> Sorry, in my example, I think actually clang is wrong.

What is the order of destruction of tempories here in the following statement:
A() << 1

Is A() destoryed before the temp B that is returned from operator <<.

Note MSVC accepts the code so it might be a bug in clang.


More information about the Gcc-bugs mailing list