[cfe-commits] r57841 - in /cfe/trunk: lib/AST/ASTContext.cpp lib/Sema/SemaExpr.cpp test/SemaObjC/comptypes-1.m test/SemaObjC/comptypes-7.m

steve naroff snaroff at apple.com
Mon Oct 20 17:25:14 PDT 2008


On Oct 20, 2008, at 8:14 PM, Eli Friedman wrote:

> On Mon, Oct 20, 2008 at 11:19 AM, Steve Naroff <snaroff at apple.com>  
> wrote:
>> Author: snaroff
>> Date: Mon Oct 20 13:19:10 2008
>> New Revision: 57841
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=57841&view=rev
>> Log:
>> Sema::CheckCompareOperands() and ASTContext::mergeTypes(): Change  
>> handling of ObjC qualified id types to be consistent with gcc. This  
>> changes a handful of test case errors into warnings (diff will tell  
>> you which cases have changed).
>
> Using an == comparison for testing the result of mergeTypes is likely
> to be confusing, because there are additional rules for ==, and gcc
> tends to be loose in when it allows comparisons.  I'd suggest tests
> using either __builtin_types_compatible_p or something like the
> following:
>
> TypeA* test1;
> TypeB* test1;
>

Good point, though I was simply changing the error->warning.

I agree it would be useful to modify the test cases in comptypes-1.m  
and comptypes-7.m (and possibly others).

snaroff

> -Eli




More information about the cfe-commits mailing list