When upgrading an Objective-C class from a forward declaration to a

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
This commit is contained in:
Douglas Gregor 2010-04-09 21:30:38 +00:00
Родитель c42b6520b6
Коммит 78713d86fa
2 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -2,3 +2,11 @@
extern "C" {
@class Protocol;
}
// <rdar://problem/7827709>
extern "C" {
@class I;
}
@interface I
@end