[cfe-commits] r115713 - in /cfe/trunk: lib/Sema/SemaType.cpp test/Sema/typeof-use-deprecated.c

jahanian fjahanian at apple.com
Wed Oct 6 10:07:11 PDT 2010


On Oct 5, 2010, at 5:34 PM, John McCall wrote:

> 
> On Oct 5, 2010, at 5:26 PM, jahanian wrote:
> 
>> 
>> On Oct 5, 2010, at 5:19 PM, John McCall wrote:
>> 
>>>> 
>>> 
>>> I agree that if we want to warn here, we should at least warn about deprecated typedefs.  But my preference would be to not warn here at all.
>> 
>> Agreed. Actually, gcc does that too (please see my followup email).
> 
> I don't see this at all.  gcc seems to look through typedefs and warn based on the underlying type's deprecatedness, unfortunately using the name of the typedef.

I was trying to say the same think that you observed about gcc.
In any case, this is all done in clang to match gcc's behavior. 
In r115800.

- Fariborz

> 
> So this typeof produces a warning (misleadingly talking about 'bar'):
>  struct foo { int x; } __attribute__((deprecated));
>  typedef struct foo bar __attribute__((deprecated));
>  bar x;
>  int main() { typeof(x) y; }
> 
> But this one doesn't:
>  struct foo { int x; };
>  typedef struct foo bar __attribute__((deprecated));
>  bar x;
>  int main() { typeof(x) y; }
> 
> John.





More information about the cfe-commits mailing list