[cfe-commits] r49315 - /cfe/trunk/lib/AST/ASTContext.cpp

Chris Lattner sabre at nondot.org
Sun Apr 6 22:37:56 PDT 2008


Author: lattner
Date: Mon Apr  7 00:37:56 2008
New Revision: 49315

URL: http://llvm.org/viewvc/llvm-project?rev=49315&view=rev
Log:
Fix comment typo, do reference eval at the correct type.

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=49315&r1=49314&r2=49315&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Mon Apr  7 00:37:56 2008
@@ -1628,14 +1628,6 @@
   QualType LHS = LHS_NC.getCanonicalType();
   QualType RHS = RHS_NC.getCanonicalType();
   
-  // If two types are identical, they are are compatible
-  if (LHS == RHS)
-    return true;
-  
-  if (LHS.getCVRQualifiers() != RHS.getCVRQualifiers() ||
-      LHS.getAddressSpace() != RHS.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
   // designates the object or function denoted by the reference, and the
@@ -1645,6 +1637,15 @@
   if (ReferenceType *RT = dyn_cast<ReferenceType>(RHS))
     RHS = RT->getPointeeType();
   
+  // If two types are identical, they are compatible.
+  if (LHS == RHS)
+    return true;
+  
+  // If qualifiers differ, the types are different.
+  if (LHS.getCVRQualifiers() != RHS.getCVRQualifiers() ||
+      LHS.getAddressSpace() != RHS.getAddressSpace())
+    return false;
+
   Type::TypeClass LHSClass = LHS->getTypeClass();
   Type::TypeClass RHSClass = RHS->getTypeClass();
   





More information about the cfe-commits mailing list