]> granicus.if.org Git - clang/commitdiff
When upgrading an Objective-C class from a forward declaration to a
authorDouglas Gregor <dgregor@apple.com>
Fri, 9 Apr 2010 21:30:38 +0000 (21:30 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 9 Apr 2010 21:30:38 +0000 (21:30 +0000)
full-fledged @interface, be sure that the declaration has the right
lexical context. <rdar://problem/7827709>

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

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

index 7e5e40c56262899572473230b2e075e9a5e43287..eb3f4222b695120da7243b11fe287be4b9b98a50 100644 (file)
@@ -98,6 +98,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
       // Since this ObjCInterfaceDecl was created by a forward declaration,
       // we now add it to the DeclContext since it wasn't added before
       // (see ActOnForwardClassDeclaration).
+      IDecl->setLexicalDeclContext(CurContext);
       CurContext->addDecl(IDecl);
       
       if (AttrList)
index b4e809eee1619a008d03c49498225f3acb6a0c1a..1454e6a6782cb16132145053bad1f6cd79dca78f 100644 (file)
@@ -2,3 +2,11 @@
 extern "C" {
 @class Protocol;
 }
+
+// <rdar://problem/7827709>
+extern "C" {
+@class I;
+}
+
+@interface I
+@end