Index: include/clang/Sema/AttributeList.h =================================================================== --- include/clang/Sema/AttributeList.h +++ include/clang/Sema/AttributeList.h @@ -140,6 +140,12 @@ virtual bool existsInTarget(const TargetInfo &Target) const { return true; } + /// If this ParsedAttrInfo knows how to apply an attribute to a decl then do + /// so and return true. If not return false. + virtual bool handleDeclAttribute(Sema &S, Decl *D, + const AttributeList &Attr) { + return false; + } }; /// AttributeList - Represents a syntactic attribute. Index: lib/Sema/SemaDeclAttr.cpp =================================================================== --- lib/Sema/SemaDeclAttr.cpp +++ lib/Sema/SemaDeclAttr.cpp @@ -5752,6 +5752,9 @@ if (handleCommonAttributeFeatures(S, scope, D, Attr)) return; + if (Attr.getInfo()->handleDeclAttribute(S, D, Attr)) + return; + switch (Attr.getKind()) { default: if (!Attr.isStmtAttr()) {