According to C99 6.3.2.1p1, structs and unions with nested
const-qualified fields (that is, const-qualified fields
declared at some recursive level of the aggregate) are not
modifiable lvalues. However, Clang permits assignments of
these lvalues.
With this patch, we both prohibit the assignment of records
with const-qualified fields and emit a best-effort diagnostic.
This fixes https://bugs.llvm.org/show_bug.cgi?id=31796 .
Shouldn't there be one more entry here as well?
(see comment about updating both err_typecheck_assign_const and note_typecheck_assign_const when adding things to the enum at line 10181).
If I understand it correctly you never print notes for the new NestedConstMember, so there isn't really a need for a fifth entry in the select today.
But if someone adds new enum values later (putting them after NestedContMember) then it might be nice if the size of this select matches with the old size of the enum.