In C11 the term temporary lifetime
was defined:
C11 6.2.4p8: A non-lvalue expression with structure or union type, where the structure or union contains a member with array type (including, recursively, members of all contained structures and unions) refers to an object with automatic storage duration and temporary lifetime. 36) Its lifetime begins when the expression is evaluated and its initial value is the value of the expression. Its lifetime ends when the evaluation of the containing full expression or full declarator ends. Any attempt to modify an object with temporary lifetime results in undefined behavior.
I am wondering why this only applies to rvalues of structure or union type which have a member of type array. What is so special about arrays?
struct x { int xx; };
struct y { int yy[1]; };
(struct x) { 42 }; // *not* a temporary object
(struct y) { { 42 } }; // a temporary object
Why should the first object not be a temporary one while the second is?