[cfe-commits] [PATCH] c++11 type attribute fix

Eli Friedman eli.friedman at gmail.com
Tue Oct 23 15:30:58 PDT 2012

On Tue, Oct 23, 2012 at 3:04 PM, Michael Han <Michael.Han at autodesk.com> wrote:
> Hi Eli,
> Thank you for the review!
> I was using "<" to differentiate case '[[foo]] int x' from 'int [[foo]] x'. Is there a reliable way to tell from SourceLocation that one construct appears before the other?

SourceManager::isBeforeInTranslationUnit .  But something has already
gone wrong if in "[[foo]] int [[foo]] x;", both attributes end up in
the same attribute list.

> Regarding "try to apply to a type, fall back to a decl": the patch tries to avoid that by having all C++11 attributes that apply to types get processed in processTypeAttrs, so C++11 attributes are either get handled directly (like carries_dependency), or warns on default case; there is no fall back to declaration. Do you think this strategy is in general valid and if so any suggestions on the best place to handle C++11 attributes that applies to types?

I don't understand why you're special-casing AT_CarriesDependency.
Otherwise, that makes sense.


More information about the cfe-commits mailing list