From d03de6aaa312d57dcd6e2bc76bed1e89f5c5019d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 29 Jan 2013 10:02:16 +0000 Subject: Downgrade 'attribute ignored when parsing type' from error to warning, to match the diagnostic's warn_ name. Switch some places (notably C++11 attributes) which really wanted an error over to a different diagnostic. Finally, suppress the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing diagnostics in important system headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173788 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaType.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/Sema/SemaType.cpp') 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; -- cgit v1.2.3-18-g5258