summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-08-25 22:26:53 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-08-25 22:26:53 +0000
commit371376010f3be4bf97b3ebe4ba4f0359bfb32cde (patch)
treef79fc76abd0a40ffd6a96dd9ea5047d91fc52233 /clang
parent440f954d6feed2fc47139032ac34a28f7c730e63 (diff)
downloadbcm5719-llvm-371376010f3be4bf97b3ebe4ba4f0359bfb32cde.tar.gz
bcm5719-llvm-371376010f3be4bf97b3ebe4ba4f0359bfb32cde.zip
objc - fix a bug exposed by my recent decl context
changes. // rdar://10015110 llvm-svn: 138594
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp3
-rw-r--r--clang/test/SemaObjCXX/linkage-spec.mm9
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 7a9d6d50729..03081bec138 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -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);
diff --git a/clang/test/SemaObjCXX/linkage-spec.mm b/clang/test/SemaObjCXX/linkage-spec.mm
index 1454e6a6782..584571de963 100644
--- a/clang/test/SemaObjCXX/linkage-spec.mm
+++ b/clang/test/SemaObjCXX/linkage-spec.mm
@@ -10,3 +10,12 @@ extern "C" {
@interface I
@end
+
+// rdar://10015110
+@protocol VKAnnotation;
+extern "C" {
+
+@protocol VKAnnotation
+ @property (nonatomic, assign) id coordinate;
+@end
+}
OpenPOWER on IntegriCloud