summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index bbbe343db0a..13a009090f9 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -1227,8 +1227,12 @@ ExprResult Sema::ParseObjCProtocolExpression(IdentifierInfo *ProtocolId,
Diag(ProtoLoc, diag::err_undeclared_protocol) << ProtocolId;
return true;
}
- if (PDecl->hasDefinition())
+ if (!PDecl->hasDefinition()) {
+ Diag(ProtoLoc, diag::err_atprotocol_protocol) << PDecl;
+ Diag(PDecl->getLocation(), diag::note_entity_declared_at) << PDecl;
+ } else {
PDecl = PDecl->getDefinition();
+ }
QualType Ty = Context.getObjCProtoType();
if (Ty.isNull())
OpenPOWER on IntegriCloud