зеркало из https://github.com/microsoft/clang-1.git
Fix crash at @implementation with a forward reference as base class.
rdar://11020003 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152596 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
78dae24600
Коммит
cd707abbc7
|
@ -925,6 +925,8 @@ Decl *Sema::ActOnStartClassImplementation(
|
|||
Diag(PrevDecl->getLocation(), diag::note_previous_definition);
|
||||
} else {
|
||||
SDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
|
||||
if (SDecl && !SDecl->hasDefinition())
|
||||
SDecl = 0;
|
||||
if (!SDecl)
|
||||
Diag(SuperClassLoc, diag::err_undef_superclass)
|
||||
<< SuperClassname << ClassName;
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
@end
|
||||
|
||||
// Forward-declared interface
|
||||
@class I12, I10;
|
||||
@class I10; @interface I12 @end
|
||||
@interface I11
|
||||
@end
|
||||
|
||||
|
|
|
@ -42,3 +42,9 @@ void foo() {
|
|||
@end
|
||||
|
||||
@end // expected-error {{'@end' must appear in an Objective-C context}}
|
||||
|
||||
@class ForwardBase;
|
||||
@implementation SomeI : ForwardBase // expected-error {{cannot find interface declaration for 'ForwardBase', superclass of 'SomeI'}} \
|
||||
// expected-warning {{cannot find interface declaration for 'SomeI'}}
|
||||
-(void)meth {}
|
||||
@end
|
||||
|
|
Загрузка…
Ссылка в новой задаче