https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120025
--- Comment #2 from Stas Sergeev <stsp at users dot sourceforge.net> --- (In reply to Andrew Pinski from comment #1) > I am not even sure what assignable temporaries is. Do you have an example? ``` #include <iostream> struct A { int a; ~A() { std::cout << "a=" << a << std::endl; } }; struct B { A foo() { return A(); } }; int main() { B b; b.foo().a = 5; return 0; } ``` $ clang++ astmp.cpp astmp.cpp:15:15: error: expression is not assignable 15 | b.foo().a = 5; | ~~~~~~~~~ ^ 1 error generated. $ g++ astmp.cpp -fpermissive astmp.cpp: In function ‘int main()’: astmp.cpp:15:13: warning: using rvalue as lvalue [-fpermissive] 15 | b.foo().a = 5; | ~~~~~~~~^ $ ./a.out a=5