summaryrefslogtreecommitdiffstats
path: root/clang
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
commit1e3609f6c48d4908773478c7e7b99ec3026886eb (patch)
tree71a38dbf134b740a1accda3edef25f469739462c /clang
parent6a96bf7d6e33d18d0599210941f893e3de3612fe (diff)
downloadbcm5719-llvm-1e3609f6c48d4908773478c7e7b99ec3026886eb.tar.gz
bcm5719-llvm-1e3609f6c48d4908773478c7e7b99ec3026886eb.zip
Do not enter forward class 'Protocol' in decl context.
Will do it later. Fixes pr5552. llvm-svn: 89269
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/Sema.cpp2
-rw-r--r--clang/test/SemaObjC/class-protocol.m6
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index b2bbac8bc2a..fe2d7448b42 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/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/clang/test/SemaObjC/class-protocol.m b/clang/test/SemaObjC/class-protocol.m
new file mode 100644
index 00000000000..12b63817513
--- /dev/null
+++ b/clang/test/SemaObjC/class-protocol.m
@@ -0,0 +1,6 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+// pr5552
+
+@interface Protocol
+@end
+
OpenPOWER on IntegriCloud