On Mon, 23 Nov 2020, Uecker, Martin wrote:

> Joseph,
> 
> here is the patch to not drop qualifiers for _Atomic in
> typeof. I am not sure whether this is appropriate in
> stage3, but I wanted to leave it here for you to comment
> and so that it does not lost.
> 
> First, I noticed that the change to drop qualifiers
> in lvalue conversion also implies that __auto_type now
> always uses the non-qualified type. I think this is more
> correct, and also what other compilers and C++'s auto do.
> The first change here in c-parser would remove the now
> redundant code to drop qualifiers for _Atomic types.
> 
> The second change would remove the code to drop qualifiers
> for _Atomic types for typeof. I would then use the
> comma operator for stdatomic to remove all qualifiers.
> Here, the question is whether this may have same
> unintended side effects.

This is OK, with references to bugs 65455 and 92935 as I think it fixes 
those.

Any change to qualifiers for typeof risks breaking something relying on 
the details of when the result is or is not qualified, but given that in 
previous GCC versions that was poorly defined and inconsistent, making 
these changes to make it more consistent seems reasonable.

It is probably still the case that _Typeof as proposed for ISO C would 
need special handling of function and function pointer types for the same 
reason as _Generic has such handling (_Noreturn not being part of the 
function type as defined by ISO C).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to