forked from OSchip/llvm-project
Remove warning on future change in ivar lookup rule
when doing the property default synthesis. // rdar://9027673. llvm-svn: 126128
This commit is contained in:
parent
b4863a41e9
commit
f5bfc46c95
|
@ -2950,10 +2950,7 @@ def note_equality_comparison_silence : Note<
|
|||
def warn_synthesized_ivar_access : Warning<
|
||||
"direct access of synthesized ivar by using property access %0">,
|
||||
InGroup<NonfragileAbi2>, DefaultIgnore;
|
||||
def warn_ivar_variable_conflict : Warning<
|
||||
"when default property synthesis is on, "
|
||||
"%0 lookup will access property ivar instead of global variable">,
|
||||
InGroup<NonfragileAbi2>;
|
||||
|
||||
def note_global_declared_at : Note<"global variable declared here">;
|
||||
|
||||
// assignment related diagnostics (also for argument passing, returning, etc).
|
||||
|
|
|
@ -1675,20 +1675,6 @@ ExprResult Sema::ActOnIdExpression(Scope *S,
|
|||
// This is guaranteed from this point on.
|
||||
assert(!R.empty() || ADL);
|
||||
|
||||
if (VarDecl *Var = R.getAsSingle<VarDecl>()) {
|
||||
if (getLangOptions().ObjCNonFragileABI && IvarLookupFollowUp &&
|
||||
!(getLangOptions().ObjCDefaultSynthProperties &&
|
||||
getLangOptions().ObjCNonFragileABI2) &&
|
||||
Var->isFileVarDecl()) {
|
||||
ObjCPropertyDecl *Property = canSynthesizeProvisionalIvar(II);
|
||||
if (Property) {
|
||||
Diag(NameLoc, diag::warn_ivar_variable_conflict) << Var->getDeclName();
|
||||
Diag(Property->getLocation(), diag::note_property_declare);
|
||||
Diag(Var->getLocation(), diag::note_global_declared_at);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check whether this might be a C++ implicit instance member access.
|
||||
// C++ [class.mfct.non-static]p3:
|
||||
// When an id-expression that is not part of a class member access
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// RUN: %clang_cc1 -fobjc-nonfragile-abi -verify -fsyntax-only %s
|
||||
// rdar://8225011
|
||||
|
||||
int glob; // expected-note {{global variable declared here}}
|
||||
int glob;
|
||||
|
||||
@interface I
|
||||
@property int glob; // expected-note {{property declared here}}
|
||||
@property int glob;
|
||||
@property int p;
|
||||
@property int le;
|
||||
@property int l;
|
||||
|
@ -12,8 +12,10 @@ int glob; // expected-note {{global variable declared here}}
|
|||
@property int r;
|
||||
@end
|
||||
|
||||
// rdar://9027673
|
||||
// Warning on future name lookup rule is removed.
|
||||
@implementation I
|
||||
- (int) Meth { return glob; } // expected-warning {{when default property synthesis is on, 'glob' lookup will access}}
|
||||
- (int) Meth { return glob; } // no warning
|
||||
@synthesize glob;
|
||||
// rdar://8248681
|
||||
- (int) Meth1: (int) p {
|
||||
|
|
Loading…
Reference in New Issue