зеркало из https://github.com/microsoft/clang.git
error on property of objc interface type instead of crashing
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78826 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
46730b261c
Коммит
acf2d137f3
|
@ -1940,6 +1940,8 @@ Sema::DeclPtrTy Sema::ActOnProperty(Scope *S, SourceLocation AtLoc,
|
|||
Diag(AtLoc, diag::warn_implements_nscopying)
|
||||
<< FD.D.getIdentifier();
|
||||
}
|
||||
if (T->isObjCInterfaceType())
|
||||
Diag(FD.D.getIdentifierLoc(), diag::err_statically_allocated_object);
|
||||
|
||||
DeclContext *DC = dyn_cast<DeclContext>(ClassDecl);
|
||||
assert(DC && "ClassDecl is not a DeclContext");
|
||||
|
|
|
@ -32,3 +32,11 @@ Super foo( // expected-error{{interface interface type 'Super' cannot be returne
|
|||
Super p1; // expected-error{{interface type cannot be statically allocated}}
|
||||
return p1;
|
||||
}
|
||||
|
||||
@interface NSMutableSet @end
|
||||
|
||||
@interface DVTDummyAnnotationProvider
|
||||
@property(readonly) NSMutableSet annotations; // expected-error{{interface type cannot be statically allocated}}
|
||||
|
||||
@end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче