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
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
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 *'}}
}