aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaExprCXX.cpp2
-rw-r--r--test/SemaObjCXX/overload.mm4
-rw-r--r--test/SemaObjCXX/related-result-type-inference.mm2
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 27659f6507..50462abd3a 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -2211,7 +2211,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
case ICK_Pointer_Conversion: {
if (SCS.IncompatibleObjC && Action != AA_Casting) {
// Diagnose incompatible Objective-C conversions
- if (Action == AA_Initializing)
+ if (Action == AA_Initializing || Action == AA_Assigning)
Diag(From->getSourceRange().getBegin(),
diag::ext_typecheck_convert_incompatible_pointer)
<< ToType << From->getType() << Action
diff --git a/test/SemaObjCXX/overload.mm b/test/SemaObjCXX/overload.mm
index 960a7b228f..ea5f0e5932 100644
--- a/test/SemaObjCXX/overload.mm
+++ b/test/SemaObjCXX/overload.mm
@@ -52,12 +52,12 @@ void test0(A* a, B* b, id val) {
void test1(A* a) {
B* b = a; // expected-warning{{incompatible pointer types initializing 'B *' with an expression of type 'A *'}}
- B *c; c = a; // expected-warning{{incompatible pointer types assigning to 'A *' from 'B *'}}
+ B *c; c = a; // expected-warning{{incompatible pointer types assigning to 'B *' from 'A *'}}
}
void test2(A** ap) {
B** bp = ap; // expected-warning{{incompatible pointer types initializing 'B **' with an expression of type 'A **'}}
- bp = ap; // expected-warning{{incompatible pointer types assigning to 'A **' from 'B **'}}
+ bp = ap; // expected-warning{{incompatible pointer types assigning to 'B **' from 'A **'}}
}
// FIXME: we should either allow overloading here or give a better diagnostic
diff --git a/test/SemaObjCXX/related-result-type-inference.mm b/test/SemaObjCXX/related-result-type-inference.mm
index 58fb961e23..accec793ad 100644
--- a/test/SemaObjCXX/related-result-type-inference.mm
+++ b/test/SemaObjCXX/related-result-type-inference.mm
@@ -66,5 +66,5 @@ void test_inference() {
NSArray *arr = [[NSMutableArray alloc] init];
NSMutableArray *marr = [arr retain]; // expected-warning{{incompatible pointer types initializing 'NSMutableArray *' with an expression of type 'NSArray *'}}
- marr = [arr retain]; // expected-warning{{incompatible pointer types assigning to 'NSArray *' from 'NSMutableArray *'}}
+ marr = [arr retain]; // expected-warning{{incompatible pointer types assigning to 'NSMutableArray *' from 'NSArray *'}}
}