diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-29 16:53:53 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-29 16:53:53 +0000 |
| commit | c15dfd8a87b15dd4fde2ff7bf5e2ecc73e9ff7cc (patch) | |
| tree | 47e017766cef701b8c809e4759709b6714d3d271 /clang | |
| parent | e9bf2d159c8dc747becc32007b8c222af9f7d425 (diff) | |
| download | bcm5719-llvm-c15dfd8a87b15dd4fde2ff7bf5e2ecc73e9ff7cc.tar.gz bcm5719-llvm-c15dfd8a87b15dd4fde2ff7bf5e2ecc73e9ff7cc.zip | |
Tigthen the condition for issung ivar shadowing
variables to those in file scope (nonfragile-abi2).
Fixes radar 8248681.
llvm-svn: 109758
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 3 | ||||
| -rw-r--r-- | clang/test/SemaObjC/conflict-nonfragile-abi2.m | 21 |
2 files changed, 23 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 6f971b116d6..a934adfb0c4 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -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) { diff --git a/clang/test/SemaObjC/conflict-nonfragile-abi2.m b/clang/test/SemaObjC/conflict-nonfragile-abi2.m index 49cff97ccbd..14e666000c6 100644 --- a/clang/test/SemaObjC/conflict-nonfragile-abi2.m +++ b/clang/test/SemaObjC/conflict-nonfragile-abi2.m @@ -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 + + |

