Using a temporary array as an lvalue
问题 This program is ill-formed: struct X { int i; }; int main() { (X { }).i = 1; } i , a sub-object of the temporary X { } , cannot be used as an lvalue because X { } is an rvalue. However, this silently compiles with GCC 5.2.1 and -Wall : using Y = int[10]; int main() { (Y { })[0] = 1; } If the compiler is correct, then this time, the zeroth element of (Y { }) , which is a subobject of (Y { }) , can be treated as an lvalue. My questions are: Is the second program ill-formed? Why (not), even