[cfe-dev] handle __attribute__((deprecated))

Chris Lattner clattner at apple.com
Fri Feb 29 10:12:20 PST 2008


On Feb 29, 2008, at 10:09 AM, Nuno Lopes wrote:

>>> The test currently doesn't pass because attributes aren't being  
>>> propagated when merging functions/vars definitions.
>>>
>>> e.g.
>>> void g() __attribute__((deprecated));
>>> void g();
>>>
>>> int a() {
>>> //should produce a warning. it does not as clang discards the old  
>>> defnition and its attributes when merging
>>> g();
>>> }
>>
>> Ok, for now, I just disabled these cases from the test case.  It  
>> would  be nice to have this but can happen as a separate step.
>
> Ok. But how should clang handle this attribute merging? Simply  
> append the old declaration atrributes to the new ones? Append just  
> non-repeating ones? Or..?

It depends on the attributes, but yes they should generally be merged.

> BTW, I just saw how noreturn is handled (it enforces 0 parameters).  
> Do you prefer having this enforcement done in deprecated as well as  
> other attributes?

Yep, please.

>>> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080225/004488.html
>
> Thanks. BTW, you forgot to commit the test.

Whoops, fixed.  Forgot to svn add it.  Thanks,

-Chris



More information about the cfe-dev mailing list