diff options
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index d716917b9c..ce75122b3d 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -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 |