[cfe-commits] r171899 - in /cfe/trunk: lib/Sema/SemaDeclAttr.cpp test/Sema/attr-availability.c

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Jan 9 08:01:29 PST 2013


>> +  NamedDecl *ND = dyn_cast<NamedDecl>(D);
>> +  if (!ND) {
>> +    S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << Attr.getName();
>> +    return;
>> +  }
>
> Rafael,
>
> I'm concerned by attribute abuse.  We just warn on too many weird
> cases instead of throwing an error.  I can understand "legacy code"
> reasons, but this particular case never compiled, so there's no reason
> to be forgiving.
>
> Maybe I am misunderstanding something...

I would be more than happy to make this an error, but

* We are very forgiving with the availability attribute for some
reason. We warn if it is declared to be available after 10.5 and 10.7
for example.
* This is used mostly (only?) by apple, so I it is probably best if
they decide whether this should be an error or warning.

> Dmitri
>

Cheers,
Rafael



More information about the cfe-commits mailing list