]> granicus.if.org Git - clang/commitdiff
objc - fix a bug exposed by my recent decl context
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 25 Aug 2011 22:26:53 +0000 (22:26 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 25 Aug 2011 22:26:53 +0000 (22:26 +0000)
changes. // rdar://10015110

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

lib/Sema/SemaDeclObjC.cpp
test/SemaObjCXX/linkage-spec.mm

index 7a9d6d50729b39df9d741da426eb69ab318087b0..03081bec1388f7ab2c8e4006282bb1f837a3dcf5 100644 (file)
@@ -540,6 +540,9 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc,
     // Make sure the cached decl gets a valid start location.
     PDecl->setLocation(AtProtoInterfaceLoc);
     PDecl->setForwardDecl(false);
+    // Since this ObjCProtocolDecl was created by a forward declaration,
+    // we now add it to the DeclContext since it wasn't added before
+    PDecl->setLexicalDeclContext(CurContext);
     CurContext->addDecl(PDecl);
     // Repeat in dependent AST files.
     PDecl->setChangedSinceDeserialization(true);
index 1454e6a6782cb16132145053bad1f6cd79dca78f..584571de9636bc82dc82aa6fd926a1e416fe6bbb 100644 (file)
@@ -10,3 +10,12 @@ extern "C" {
 
 @interface I
 @end
+
+// rdar://10015110
+@protocol VKAnnotation;
+extern "C" {
+
+@protocol VKAnnotation
+  @property (nonatomic, assign) id coordinate;
+@end
+}