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

Nuno Lopes nunoplopes at sapo.pt
Fri Feb 29 10:09:46 PST 2008

>> 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? 
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 

>> If there's interest, I'll provide patches to handle other 
>> __attributes__.
> That would be great, thanks Nuno!


> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080225/004488.html

Thanks. BTW, you forgot to commit the test.


More information about the cfe-dev mailing list