зеркало из https://github.com/microsoft/clang-1.git
Allow for declaration and use of ivars in a stand-alone
implementation (toward radar 7547942). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96479 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2e2a400383
Коммит
3a21cd92f4
|
@ -823,6 +823,12 @@ void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl,
|
|||
if (IDecl->isImplicitInterfaceDecl()) {
|
||||
IDecl->setIVarList(ivars, numIvars, Context);
|
||||
IDecl->setLocEnd(RBrace);
|
||||
// Add ivar's to class's DeclContext.
|
||||
for (unsigned i = 0, e = numIvars; i != e; ++i) {
|
||||
ivars[i]->setLexicalDeclContext(IDecl);
|
||||
IDecl->addDecl(ivars[i]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
// If implementation has empty ivar list, just return.
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// radar 7547942
|
||||
// Allow injection of ivars into implementation's implicit class.
|
||||
|
||||
@implementation INTFSTANDALONE // expected-warning {{cannot find interface declaration for 'INTFSTANDALONE'}}
|
||||
{
|
||||
id IVAR1;
|
||||
id IVAR2;
|
||||
}
|
||||
- (id) Meth { return IVAR1; }
|
||||
@end
|
||||
|
Загрузка…
Ссылка в новой задаче