[Bug c++/109470] unexpected const & behavior

2023-04-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109470 --- Comment #8 from Jonathan Wakely --- No, "full-expression" is a formal term defined very precisely in the C++ standard. There is no opportunity for GCC to review that without failing to conform to the C++ standard. Changing when temporary

[Bug c++/109470] unexpected const & behavior

2023-04-11 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109470 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment

[Bug c++/109470] unexpected const & behavior

2023-04-11 Thread johannes.kellner at wandelbots dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109470 --- Comment #6 from Johannes Kellner --- Ok, Ok :) It's not to me to argue this. It's just an unexpected behavior (something I was unaware off/ something that does not happen when doing the same code with other compilers clang/msvc). And in

[Bug c++/109470] unexpected const & behavior

2023-04-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109470 --- Comment #5 from Jonathan Wakely --- (In reply to Johannes Kellner from comment #3) > 'A temporary object bound to a reference parameter in a function call > persists until the completion of the full-expression containing the call.' > > So

[Bug c++/109470] unexpected const & behavior

2023-04-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109470 Andrew Pinski changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug c++/109470] unexpected const & behavior

2023-04-11 Thread johannes.kellner at wandelbots dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109470 Johannes Kellner changed: What|Removed |Added Resolution|INVALID |--- Status|RESOLVED

[Bug c++/109470] unexpected const & behavior

2023-04-11 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109470 --- Comment #2 from Xi Ruoyao --- With "-Wall -O1" this is diagnosed properly, but with a spurious maybe-uninitialized warning: In file included from /usr/include/c++/12.2.0/cassert:44, from t.c:2: t.c: In function 'int

[Bug c++/109470] unexpected const & behavior

2023-04-11 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109470 Xi Ruoyao changed: What|Removed |Added CC||xry111 at gcc dot gnu.org