[cfe-commits] r138594 - in /cfe/trunk: lib/Sema/SemaDeclObjC.cpp test/SemaObjCXX/linkage-spec.mm
Fariborz Jahanian
fjahanian at apple.com
Thu Aug 25 15:26:53 PDT 2011
Author: fjahanian
Date: Thu Aug 25 17:26:53 2011
New Revision: 138594
URL: http://llvm.org/viewvc/llvm-project?rev=138594&view=rev
Log:
objc - fix a bug exposed by my recent decl context
changes. // rdar://10015110
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/test/SemaObjCXX/linkage-spec.mm
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=138594&r1=138593&r2=138594&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Aug 25 17:26:53 2011
@@ -540,6 +540,9 @@
// 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);
Modified: cfe/trunk/test/SemaObjCXX/linkage-spec.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/linkage-spec.mm?rev=138594&r1=138593&r2=138594&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/linkage-spec.mm (original)
+++ cfe/trunk/test/SemaObjCXX/linkage-spec.mm Thu Aug 25 17:26:53 2011
@@ -10,3 +10,12 @@
@interface I
@end
+
+// rdar://10015110
+ at protocol VKAnnotation;
+extern "C" {
+
+ at protocol VKAnnotation
+ @property (nonatomic, assign) id coordinate;
+ at end
+}
More information about the cfe-commits
mailing list