forked from OSchip/llvm-project
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:
parent
b308902024
commit
9312fcc2d3
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue