This Stackoverflow question https://stackoverflow.com/q/33161003/1708801 provides the following code: using Y = int[10]; int main() { (Y { })[0] = 1; } which compiles without diagnostic, CWG defect report 1213: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1213 says the result of the subscript operator should be an xvalue and therefore not assignable to. Also see the following clang bug report on the same issue, which was resolved at the end of 2017: https://bugs.llvm.org/show_bug.cgi?id=25357 I have a godbolt for it here: https://godbolt.org/g/AmzbFh We can see that clang no longer allows this but gcc does.
I'm pretty sure this is a dup of an existing bug.
. *** This bug has been marked as a duplicate of bug 79832 ***
*** Bug 86187 has been marked as a duplicate of this bug. ***