]> granicus.if.org Git - clang/commitdiff
Fix an incorrect assertion.
authorAnders Carlsson <andersca@mac.com>
Sat, 13 Oct 2007 05:52:34 +0000 (05:52 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 13 Oct 2007 05:52:34 +0000 (05:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42951 91177308-0d34-0410-b5e6-96231b3b80d8

CodeGen/CGExprScalar.cpp

index 755fd56de66007f61f6fb1316f1a2942ea0a694a..97efa33fc5a3fb29e76909d9674b0af4748a6815 100644 (file)
@@ -419,8 +419,9 @@ Value *ScalarExprEmitter::VisitImplicitCastExpr(const ImplicitCastExpr *E) {
     llvm::Value *Ops[] = {Idx0, Idx0};
     return Builder.CreateGEP(V, Ops, Ops+2, "arraydecay");
   } else if (E->getType()->isReferenceType()) {
-    assert(cast<ReferenceType>(E->getType())->getReferenceeType() == 
-           Op->getType() && "Incompatible types!");
+    assert(cast<ReferenceType>(E->getType().getCanonicalType())->
+           getReferenceeType() == 
+           Op->getType().getCanonicalType() && "Incompatible types!");
     
     return EmitLValue(Op).getAddress();
   }