aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaExpr.cpp3
-rw-r--r--test/SemaObjC/synth-provisional-ivars-1.m28
2 files changed, 30 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 9ebfb05933..3112ccb55f 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -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;
diff --git a/test/SemaObjC/synth-provisional-ivars-1.m b/test/SemaObjC/synth-provisional-ivars-1.m
new file mode 100644
index 0000000000..33de173cc1
--- /dev/null
+++ b/test/SemaObjC/synth-provisional-ivars-1.m
@@ -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