summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index a1f385688e1..3e583862092 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -55,7 +55,9 @@ enum AttributeDeclKind {
ExpectedVariableFieldOrTag,
ExpectedTypeOrNamespace,
ExpectedObjectiveCInterface,
- ExpectedMethodOrProperty
+ ExpectedMethodOrProperty,
+ ExpectedStructOrUnion,
+ ExpectedStructOrUnionOrClass
};
//===----------------------------------------------------------------------===//
@@ -4392,8 +4394,10 @@ static void handleNSBridgedAttr(Sema &S, Scope *Sc, Decl *D,
static void handleObjCBridgeAttr(Sema &S, Scope *Sc, Decl *D,
const AttributeList &Attr) {
if (!isa<RecordDecl>(D)) {
- S.Diag(D->getLocStart(), diag::err_objc_bridge_attribute)
- << S.getLangOpts().CPlusPlus;
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_decl_type)
+ << Attr.getName()
+ << (S.getLangOpts().CPlusPlus ? ExpectedStructOrUnionOrClass
+ : ExpectedStructOrUnion);
return;
}
OpenPOWER on IntegriCloud