Tweak the rule for deciding if a provisional ivar is needed

in default ivar synthesis.  Fixes // rdar://8913053.

llvm-svn: 124258
This commit is contained in:
Fariborz Jahanian 2011-01-26 00:57:01 +00:00
parent b308902024
commit 9312fcc2d3
2 changed files with 30 additions and 1 deletions

View File

@ -1354,7 +1354,8 @@ static ObjCIvarDecl *SynthesizeProvisionalIvar(Sema &SemaRef,
LookForIvars = false;
else
LookForIvars = (Lookup.isSingleResult() &&
Lookup.getFoundDecl()->isDefinedOutsideFunctionOrMethod());
Lookup.getFoundDecl()->isDefinedOutsideFunctionOrMethod() &&
(Lookup.getAsSingle<VarDecl>() != 0));
if (!LookForIvars)
return 0;

View File

@ -0,0 +1,28 @@
// RUN: %clang_cc1 -fsyntax-only -fobjc-nonfragile-abi -fobjc-default-synthesize-properties -verify %s
// rdar://8913053
typedef unsigned char BOOL;
@interface MailApp
{
BOOL _isAppleInternal;
}
@property(assign) BOOL isAppleInternal;
@end
static BOOL isAppleInternal() {return 0; }
@implementation MailApp
- (BOOL)isAppleInternal {
return _isAppleInternal;
}
- (void)setIsAppleInternal:(BOOL)flag {
_isAppleInternal= !!flag;
}
- (void) Meth {
self.isAppleInternal = isAppleInternal();
}
@end