aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaExpr.cpp2
-rw-r--r--test/CodeGenObjCXX/property-dot-copy.mm34
2 files changed, 35 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 2031508470..83319a8087 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -6720,7 +6720,7 @@ ExprResult Sema::BuildBinOp(Scope *S, SourceLocation OpLoc,
if (getLangOptions().CPlusPlus &&
((!isa<ObjCImplicitSetterGetterRefExpr>(lhs) &&
!isa<ObjCPropertyRefExpr>(lhs))
- || rhs->isTypeDependent()) &&
+ || rhs->isTypeDependent() || Opc != BO_Assign) &&
(lhs->getType()->isOverloadableType() ||
rhs->getType()->isOverloadableType())) {
// Find all of the overloaded operators visible from this
diff --git a/test/CodeGenObjCXX/property-dot-copy.mm b/test/CodeGenObjCXX/property-dot-copy.mm
index 35321ad5eb..9b23c58ca1 100644
--- a/test/CodeGenObjCXX/property-dot-copy.mm
+++ b/test/CodeGenObjCXX/property-dot-copy.mm
@@ -32,3 +32,37 @@ int main ()
return 0;
}
+
+// rdar: // 8437253
+extern "C" void exit(...);
+
+struct CGPoint {
+ float x;
+ float y;
+};
+typedef struct CGPoint CGPoint;
+
+extern "C" const CGPoint CGPointZero;
+
+bool operator==(const CGPoint& a, const CGPoint& b);
+
+@interface TIconViewSettings
+@property (assign, nonatomic) CGPoint gridOffset;
+@end
+
+@implementation TIconViewSettings
+- (CGPoint) gridOffset
+{
+ return CGPointZero;
+}
+
+- (void) foo
+{
+ if ((self.gridOffset) == CGPointZero)
+ exit(1);
+
+ if (self.gridOffset == CGPointZero)
+ exit(1);
+}
+@end
+