https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88822

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
If an rvalue's type (or, for that matter, an lvalue's type) is observed 
with _Generic, the qualifiers should be consistently dropped.

If a type is observed with typeof, qualifiers need to be kept in some 
cases for compatibility.  That's definitely the case with lvalues (because 
of use of typeof for defining aliases); I doubt it's the case for at least 
these rvalues.

If a type is observed in the text of a diagnostic, there are of course no 
compatibility requirements on whether qualifiers are present or not; it's 
a question of what's most helpful for the user (and for the message about 
the assignment, I don't think the qualifiers are helpful even for lvalues, 
given that the RHS has gone through lvalue-to-rvalue conversion).

(For _Atomic, the reference to p3 gets an explicit atomic_load applied by 
the compiler in its internal representation before the &* are applied, 
hence the qualifiers having been removed there.)

Reply via email to