[cfe-commits] r132868 - in /cfe/trunk: docs/ include/clang/AST/ include/clang/Basic/ include/clang/Driver/ include/clang/Sema/ lib/AST/ lib/Analysis/ lib/Basic/ lib/CodeGen/ lib/Driver/ lib/Frontend/ lib/Parse/ lib/Sema/ lib/Serialization/ test/Driver/ test/PCH/ test/SemaObjC/ test/SemaObjCXX/

Douglas Gregor dgregor at apple.com
Fri Jun 10 21:48:46 PDT 2011


On Jun 10, 2011, at 6:33 PM, Jordy Rose wrote:

> Very cool! But...
> 
> On Jun 10, 2011, at 18:09, Douglas Gregor wrote:
>> +  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 *'}}
> 
> Isn't that last message backwards?

Ah, yes it is! And this problem has been around for quite a while, apparently... fixed in r132873.

> Also, would this be a good test to add?
> 
>  arr = [marr retain]; // no-warning

Sure.

Thanks!

	- Doug



More information about the cfe-commits mailing list