diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-07-25 19:45:01 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-07-25 19:45:01 +0000 |
commit | a57d91c2aede9cb8c5e43ab86cfaebe4e43f0161 (patch) | |
tree | 8e3c6ec2d1f652c077adfccb29dd52b7f481465c /clang/lib/Sema/SemaExprObjC.cpp | |
parent | e5b6e0d2313cdd5b906bfeaf3968ff7fdd6438db (diff) | |
download | bcm5719-llvm-a57d91c2aede9cb8c5e43ab86cfaebe4e43f0161.tar.gz bcm5719-llvm-a57d91c2aede9cb8c5e43ab86cfaebe4e43f0161.zip |
Objective-C. Warn if protocol used in an @protocol
expression is a forward declaration as this results
in undefined behavior. rdar://17768630
llvm-svn: 213968
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 500233203c7..fb2c02b77fe 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -1105,6 +1105,8 @@ ExprResult Sema::ParseObjCProtocolExpression(IdentifierInfo *ProtocolId, Diag(ProtoLoc, diag::err_undeclared_protocol) << ProtocolId; return true; } + if (PDecl->hasDefinition()) + PDecl = PDecl->getDefinition(); QualType Ty = Context.getObjCProtoType(); if (Ty.isNull()) |