From ec143777ba045bf67d57834ecd29b1d108b07a68 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 7 Aug 2009 23:22:37 +0000 Subject: Add CK_ToUnion and use it for aggregate expression codegen. llvm-svn: 78429 --- clang/lib/Sema/SemaExpr.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Sema/SemaExpr.cpp') diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 684c2dafdba..6f75b59c305 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2990,6 +2990,7 @@ bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr, // FIXME: Check that the cast destination type is complete. Diag(TyR.getBegin(), diag::ext_typecheck_cast_nonscalar) << castType << castExpr->getSourceRange(); + Kind = CastExpr::CK_NoOp; } else if (castType->isUnionType()) { // GCC cast to union extension RecordDecl *RD = castType->getAs()->getDecl(); @@ -3006,6 +3007,7 @@ bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr, if (Field == FieldEnd) return Diag(TyR.getBegin(), diag::err_typecheck_cast_to_union_no_type) << castExpr->getType() << castExpr->getSourceRange(); + Kind = CastExpr::CK_ToUnion; } else { // Reject any other conversions to non-scalar types. return Diag(TyR.getBegin(), diag::err_typecheck_cond_expect_scalar) -- cgit v1.2.3