forked from OSchip/llvm-project
Tigthen the condition for issung ivar shadowing
variables to those in file scope (nonfragile-abi2). Fixes radar 8248681. llvm-svn: 109758
This commit is contained in:
parent
e9bf2d159c
commit
c15dfd8a87
|
|
@ -1170,7 +1170,8 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S,
|
|||
|
||||
if (VarDecl *Var = R.getAsSingle<VarDecl>()) {
|
||||
if (getLangOptions().ObjCNonFragileABI && IvarLookupFollowUp &&
|
||||
!getLangOptions().ObjCNonFragileABI2) {
|
||||
!getLangOptions().ObjCNonFragileABI2 &&
|
||||
Var->isFileVarDecl()) {
|
||||
ObjCPropertyDecl *Property =
|
||||
OkToSynthesizeProvisionalIvar(*this, II, NameLoc);
|
||||
if (Property) {
|
||||
|
|
|
|||
|
|
@ -5,9 +5,30 @@ int glob;
|
|||
|
||||
@interface I
|
||||
@property int glob; // expected-note {{property declared here}}
|
||||
@property int p;
|
||||
@property int le;
|
||||
@property int l;
|
||||
@property int ls;
|
||||
@property int r;
|
||||
@end
|
||||
|
||||
@implementation I
|
||||
- (int) Meth { return glob; } // expected-warning {{'glob' lookup will access the property ivar in nonfragile-abi2 mode}}
|
||||
@synthesize glob;
|
||||
// rdar: // 8248681
|
||||
- (int) Meth1: (int) p {
|
||||
extern int le;
|
||||
int l = 1;
|
||||
static int ls;
|
||||
register int r;
|
||||
p = le + ls + r;
|
||||
return l;
|
||||
}
|
||||
@dynamic p;
|
||||
@dynamic le;
|
||||
@dynamic l;
|
||||
@dynamic ls;
|
||||
@dynamic r;
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue