[cfe-commits] r64307 - in /cfe/trunk: include/clang/AST/Type.h lib/Sema/Sema.h lib/Sema/SemaTemplate.cpp lib/Sema/SemaType.cpp

Douglas Gregor dgregor at apple.com
Wed Feb 11 10:23:15 PST 2009


On Feb 11, 2009, at 10:10 AM, Chris Lattner wrote:

> On Feb 11, 2009, at 8:47 AM, Douglas Gregor wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=64307&view=rev
>> Log:
>> Rename Sema::hasSameType to QualType::isSameAs
>> Rename Sema::hasSameUnqualifiedType to  
>> QualType::isSameIgnoringQalifiers
>
> Hey Doug, sorry to keep bugging you about this.
>
>> +/// \brief Determine whether this type and Other represent the  
>> same type.
>> +inline bool QualType::isSameAs(QualType Other) const {
>> +  return getTypePtr()->getCanonicalTypeInternal() ==
>> +      Other.getTypePtr()->getCanonicalTypeInternal();
>> +}
>
> I don't think this is safe.  If "this" is  'const on "int[4]"' and  
> Other is "(const int)[4]", this will return false.  You need to use  
> the ASTContext version of getCanonicalType to handle this.

Ah, arrays. How strange they are. I've moved the functionality to  
ASTContext.

	- Doug



More information about the cfe-commits mailing list