[cfe-commits] r45976 - in /cfe/trunk: AST/Type.cpp test/Sema/complex-int.c

Steve Naroff snaroff at apple.com
Mon Jan 14 15:12:02 PST 2008


On Jan 14, 2008, at 2:46 PM, Neil Booth wrote:

> Steve Naroff wrote:-
>
>> Author: snaroff
>> Date: Mon Jan 14 15:38:57 2008
>> New Revision: 45976
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=45976&view=rev
>> Log:
>> Teach Type::isIntegerType() about GCC's __complex__ integer  
>> extensions...
>>
>> Bug submitted by Eli.
>>
>>
>> Added:
>>    cfe/trunk/test/Sema/complex-int.c
>> Modified:
>>    cfe/trunk/AST/Type.cpp
>>
>> Modified: cfe/trunk/AST/Type.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Type.cpp?rev=45976&r1=45975&r2=45976&view=diff
>>
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- cfe/trunk/AST/Type.cpp (original)
>> +++ cfe/trunk/AST/Type.cpp Mon Jan 14 15:38:57 2008
>> @@ -310,6 +310,9 @@
>>   if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
>>     if (TT->getDecl()->getKind() == Decl::Enum)
>>       return true;
>> +  // Check for GCC complex integer extension.
>> +  if (const ComplexType *CT = dyn_cast<ComplexType>(CanonicalType))
>> +    return CT->getElementType()->isIntegerType();
>>   if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
>>     return VT->getElementType()->isIntegerType();
>>   return false;
>
> I think this is a *really* bad idea opening up endless bugs.
>

Neil,

Just to be clear, my goal isn't to open up endless bugs. I've fixed  
*many* bugs in clang over the past year and try to be careful when  
making such changes.

Every time anyone touches some code, there is a chance of a regression  
(especially since GCC extensions aren't wildly well specified).

Apparently I just created a regression. Thanks for bringing it to my  
attention.

snaroff


> It seems we accept complex ints and vectors of ints wherever
> we accept an int, such as a switch condition, etc.
>
> Neil.




More information about the cfe-commits mailing list