Assert that the type of the cast is equal to the _unqualified_ type of the subexpression. Fixes a problem spotted by Nuno Lopes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46158 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGExprAgg.cpp b/CodeGen/CGExprAgg.cpp
index 5836262..3781407 100644
--- a/CodeGen/CGExprAgg.cpp
+++ b/CodeGen/CGExprAgg.cpp
@@ -142,7 +142,7 @@
QualType STy = E->getSubExpr()->getType().getCanonicalType();
QualType Ty = E->getType().getCanonicalType();
- assert(STy == Ty && "Implicit cast types must be equal");
+ assert(STy.getUnqualifiedType() == Ty && "Implicit cast types must be equal");
Visit(E->getSubExpr());
}