[cfe-commits] r111023 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExpr.cpp test/SemaObjC/conflict-nonfragile-abi2.m
Fariborz Jahanian
fjahanian at apple.com
Fri Aug 13 11:09:40 PDT 2010
Author: fjahanian
Date: Fri Aug 13 13:09:39 2010
New Revision: 111023
URL: http://llvm.org/viewvc/llvm-project?rev=111023&view=rev
Log:
When issuing warning for future conflict resolution,
(nonfragile-abi2), do not consider 'ivar' access
in class methods. Also, improve on diagnostics.
Radar 8304561.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaObjC/conflict-nonfragile-abi2.m
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=111023&r1=111022&r2=111023&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Aug 13 13:09:39 2010
@@ -2520,8 +2520,10 @@
"place parentheses around the assignment to silence this warning">;
def warn_ivar_variable_conflict : Warning<
- "%0 lookup will access the property ivar in nonfragile-abi2 mode">,
+ "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).
// In most of these diagnostics the %2 is a value from the
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=111023&r1=111022&r2=111023&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Fri Aug 13 13:09:39 2010
@@ -1142,6 +1142,8 @@
return ActOnIdExpression(S, SS, Id, HasTrailingLParen,
isAddressOfOperand);
}
+ // for further use, this must be set to false if in class method.
+ IvarLookupFollowUp = getCurMethodDecl()->isInstanceMethod();
}
}
@@ -1193,6 +1195,7 @@
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);
}
}
} else if (FunctionDecl *Func = R.getAsSingle<FunctionDecl>()) {
Modified: cfe/trunk/test/SemaObjC/conflict-nonfragile-abi2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/conflict-nonfragile-abi2.m?rev=111023&r1=111022&r2=111023&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/conflict-nonfragile-abi2.m (original)
+++ cfe/trunk/test/SemaObjC/conflict-nonfragile-abi2.m Fri Aug 13 13:09:39 2010
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fobjc-nonfragile-abi -verify -fsyntax-only %s
// rdar : // 8225011
-int glob;
+int glob; // expected-note {{global variable declared here}}
@interface I
@property int glob; // expected-note {{property declared here}}
@@ -13,7 +13,7 @@
@end
@implementation I
-- (int) Meth { return glob; } // expected-warning {{'glob' lookup will access the property ivar in nonfragile-abi2 mode}}
+- (int) Meth { return glob; } // expected-warning {{when default property synthesis is on, 'glob' lookup will access}}
@synthesize glob;
// rdar: // 8248681
- (int) Meth1: (int) p {
More information about the cfe-commits
mailing list