[cfe-commits] r109758 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaObjC/conflict-nonfragile-abi2.m
Fariborz Jahanian
fjahanian at apple.com
Thu Jul 29 09:53:54 PDT 2010
Author: fjahanian
Date: Thu Jul 29 11:53:53 2010
New Revision: 109758
URL: http://llvm.org/viewvc/llvm-project?rev=109758&view=rev
Log:
Tigthen the condition for issung ivar shadowing
variables to those in file scope (nonfragile-abi2).
Fixes radar 8248681.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaObjC/conflict-nonfragile-abi2.m
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=109758&r1=109757&r2=109758&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu Jul 29 11:53:53 2010
@@ -1170,7 +1170,8 @@
if (VarDecl *Var = R.getAsSingle<VarDecl>()) {
if (getLangOptions().ObjCNonFragileABI && IvarLookupFollowUp &&
- !getLangOptions().ObjCNonFragileABI2) {
+ !getLangOptions().ObjCNonFragileABI2 &&
+ Var->isFileVarDecl()) {
ObjCPropertyDecl *Property =
OkToSynthesizeProvisionalIvar(*this, II, NameLoc);
if (Property) {
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=109758&r1=109757&r2=109758&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/conflict-nonfragile-abi2.m (original)
+++ cfe/trunk/test/SemaObjC/conflict-nonfragile-abi2.m Thu Jul 29 11:53:53 2010
@@ -5,9 +5,30 @@
@interface I
@property int glob; // expected-note {{property declared here}}
+ at property int p;
+ at property int le;
+ at property int l;
+ at property int ls;
+ at 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;
+}
+ at dynamic p;
+ at dynamic le;
+ at dynamic l;
+ at dynamic ls;
+ at dynamic r;
@end
+
+
More information about the cfe-commits
mailing list