forked from OSchip/llvm-project
qualifier comparisons should be done on canonical types.
llvm-svn: 49137
This commit is contained in:
parent
03e662d5be
commit
efdc7685d4
|
@ -1801,16 +1801,16 @@ bool ASTContext::arrayTypesAreCompatible(QualType lhs, QualType rhs) {
|
|||
/// C99 6.2.7p1: Two types have compatible types if their types are the
|
||||
/// same. See 6.7.[2,3,5] for additional rules.
|
||||
bool ASTContext::typesAreCompatible(QualType lhs, QualType rhs) {
|
||||
if (lhs.getCVRQualifiers() != rhs.getCVRQualifiers() ||
|
||||
lhs.getAddressSpace() != rhs.getAddressSpace())
|
||||
return false;
|
||||
|
||||
QualType lcanon = lhs.getCanonicalType();
|
||||
QualType rcanon = rhs.getCanonicalType();
|
||||
|
||||
|
||||
// If two types are identical, they are are compatible
|
||||
if (lcanon == rcanon)
|
||||
return true;
|
||||
|
||||
if (lcanon.getCVRQualifiers() != rcanon.getCVRQualifiers() ||
|
||||
lcanon.getAddressSpace() != rcanon.getAddressSpace())
|
||||
return false;
|
||||
|
||||
// C++ [expr]: If an expression initially has the type "reference to T", the
|
||||
// type is adjusted to "T" prior to any further analysis, the expression
|
||||
|
|
Loading…
Reference in New Issue