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

Nuno Lopes nunoplopes at sapo.pt
Fri Feb 29 17:17:11 PST 2008


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

fixed in the patch in the easiest way.

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

Ok, done in the patch.

In the patch there's also code to handle nothrow+noreturn (including 
codegen), partial format support (needs tweaking in the callexpr sema), and 
adds a few more attributes that aren't used yet.
Anyway, enough for today!

Nuno 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: clang_attrs.txt
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080301/f8d99996/attachment.txt>


More information about the cfe-dev mailing list