aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 983673fec8..a71275a2c1 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -784,8 +784,10 @@ DeclContext *DeclContext::getPrimaryContext() {
return this;
case Decl::ObjCProtocol:
- // FIXME: Update when protocols properly model forward declarations.
- // For now, it's fine to fall through
+ if (ObjCProtocolDecl *Def = cast<ObjCProtocolDecl>(this)->getDefinition())
+ return Def;
+
+ return this;
case Decl::ObjCCategory:
return this;