aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-11-18 23:15:37 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-11-18 23:15:37 +0000
commit10324db994455a9a1520be6cfe5bb29685cde141 (patch)
treec095080d32886299fc3ff673dbca9ded917812be
parent275c2b47a1dc200d6b55dd867bdfeb7a91b8d876 (diff)
Do not enter forward class 'Protocol' in decl context.
Will do it later. Fixes pr5552. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89269 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/Sema.cpp2
-rw-r--r--test/SemaObjC/class-protocol.m6
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index b2bbac8bc2..fe2d7448b4 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -319,7 +319,7 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
&Context.Idents.get("Protocol"),
SourceLocation(), true);
Context.setObjCProtoType(Context.getObjCInterfaceType(ProtocolDecl));
- PushOnScopeChains(ProtocolDecl, TUScope);
+ PushOnScopeChains(ProtocolDecl, TUScope, false);
}
// Create the built-in typedef for 'id'.
if (Context.getObjCIdType().isNull()) {
diff --git a/test/SemaObjC/class-protocol.m b/test/SemaObjC/class-protocol.m
new file mode 100644
index 0000000000..12b6381751
--- /dev/null
+++ b/test/SemaObjC/class-protocol.m
@@ -0,0 +1,6 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+// pr5552
+
+@interface Protocol
+@end
+