Use the unqualified type for GCCs struct/union cast extension
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62170 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 2721bb8..41881a2 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1912,8 +1912,8 @@
// We can't check any more until template instantiation time.
} else if (!castType->isScalarType() && !castType->isVectorType()) {
// GCC struct/union extension: allow cast to self.
- if (Context.getCanonicalType(castType) !=
- Context.getCanonicalType(castExpr->getType()) ||
+ if (Context.getCanonicalType(castType).getUnqualifiedType() !=
+ Context.getCanonicalType(castExpr->getType().getUnqualifiedType()) ||
(!castType->isStructureType() && !castType->isUnionType())) {
// Reject any other conversions to non-scalar types.
return Diag(TyR.getBegin(), diag::err_typecheck_cond_expect_scalar)