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. I'm sorry
I didn't notice this before, but it seems like these should move to
ASTContext. hop hop hop,
-Chris
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits