Fix PR4027 + rdar://6808859, we were rejecting implicit casts of

aggregates even though we already accept explicit ones.  Easy fix.

llvm-svn: 69661
This commit is contained in:
Chris Lattner 2009-04-21 05:19:11 +00:00
parent 16f11c7319
commit 1f02e054a9
2 changed files with 7 additions and 0 deletions

View File

@ -1064,6 +1064,7 @@ bool Expr::isConstantInitializer(ASTContext &Ctx) const {
return Exp->getSubExpr()->isConstantInitializer(Ctx);
break;
}
case ImplicitCastExprClass:
case CStyleCastExprClass:
// Handle casts with a destination that's a struct or union; this
// deals with both the gcc no-op struct cast extension and the

View File

@ -55,3 +55,9 @@ EVAL_EXPR(26, (_Complex double)0 ? -1 : 1)
EVAL_EXPR(27, (_Complex int)0 ? -1 : 1)
EVAL_EXPR(28, (_Complex double)1 ? 1 : -1)
EVAL_EXPR(29, (_Complex int)1 ? 1 : -1)
// PR4027 + rdar://6808859
struct a { int x, y };
static struct a V2 = (struct a)(struct a){ 1, 2};
static const struct a V1 = (struct a){ 1, 2};