diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaType.cpp | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 01a3505cf7..cb6e898020 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -4851,7 +4851,7 @@ bool Sema::ProcessAccessDeclAttributeList(AccessSpecDecl *ASDecl, static void checkUnusedDeclAttributes(Sema &S, const AttributeList *A) { for ( ; A; A = A->getNext()) { // Only warn if the attribute is an unignored, non-type attribute. - if (A->isUsedAsTypeAttr()) continue; + if (A->isUsedAsTypeAttr() || A->isInvalid()) continue; if (A->getKind() == AttributeList::IgnoredAttribute) continue; if (A->getKind() == AttributeList::UnknownAttribute) { diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index c101de844b..ae8d030255 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -4283,9 +4283,11 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type, switch (attr.getKind()) { default: // A C++11 attribute on a declarator chunk must appertain to a type. - if (attr.isCXX11Attribute() && TAL == TAL_DeclChunk) + if (attr.isCXX11Attribute() && TAL == TAL_DeclChunk) { state.getSema().Diag(attr.getLoc(), diag::err_attribute_not_type_attr) - << attr.getName()->getName(); + << attr.getName(); + attr.setUsedAsTypeAttr(); + } break; case AttributeList::UnknownAttribute: @@ -4336,6 +4338,14 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type, attr.setUsedAsTypeAttr(); break; + case AttributeList::AT_Win64: + case AttributeList::AT_Ptr32: + case AttributeList::AT_Ptr64: + // FIXME: Don't ignore these. We have partial handling for them as + // declaration attributes in SemaDeclAttr.cpp; that should be moved here. + attr.setUsedAsTypeAttr(); + break; + case AttributeList::AT_NSReturnsRetained: if (!state.getSema().getLangOpts().ObjCAutoRefCount) break; |