]> granicus.if.org Git - clang/commitdiff
Do not enter forward class 'Protocol' in decl context.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 18 Nov 2009 23:15:37 +0000 (23:15 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 18 Nov 2009 23:15:37 +0000 (23:15 +0000)
Will do it later. Fixes pr5552.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89269 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp
test/SemaObjC/class-protocol.m [new file with mode: 0644]

index b2bbac8bc2a91acba067ffab57bc56f24d0e3742..fe2d7448b42f14694efd3414f585ee4d4cdfc995 100644 (file)
@@ -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 (file)
index 0000000..12b6381
--- /dev/null
@@ -0,0 +1,6 @@
+// RUN: clang-cc  -fsyntax-only -verify %s
+// pr5552
+
+@interface Protocol 
+@end
+