[llvm-dev] Qualifiers not being discarded for atomic types while compiling with clang

Joerg Sonnenberger via llvm-dev
Fri, 09 Jun 2017 13:36:26 -0000

On Fri, Jun 09, 2017 at 12:51:17PM +0530, Puneetha K via llvm-dev
wrote:
> Similarly, while trying to compile this
>
> extern int i;
> extern int _Atomic const ci;
> extern __typeof(ci) i;
>
> Clang gives error:
>
>           "Redeclaration of 'i' with a different type:
'typeof (ci)' (aka
> 'typeof _Atomic(int)') vs 'int' "
>
> while gcc compiles it successfully.
>
> This seems to be because clang probably considers Atomic int differently
> than int while gcc disregards these.

This one is entirely legit. "_Atomic int" and "int" are very
different
types, they may even have different alignment requirements.

Joerg