c:
PR c/54552
* c-typeck.c (c_cast_expr): When casting to a type requiring
C_MAYBE_CONST_EXPR to be created, pass the inner expression to
c_fully_fold first.
testsuite:
* gcc.c-torture/compile/pr54552-1.c: New test.
From-SVN: r191313
2012-09-14 Joseph Myers <joseph@codesourcery.com>
+ PR c/54552
+ * c-typeck.c (c_cast_expr): When casting to a type requiring
+ C_MAYBE_CONST_EXPR to be created, pass the inner expression to
+ c_fully_fold first.
+
+2012-09-14 Joseph Myers <joseph@codesourcery.com>
+
PR c/54103
* c-typeck.c (build_unary_op): Pass original argument of
TRUTH_NOT_EXPR to c_objc_common_truthvalue_conversion, then remove
ret = build_c_cast (loc, type, expr);
if (type_expr)
{
+ bool inner_expr_const = true;
+ ret = c_fully_fold (ret, require_constant_value, &inner_expr_const);
ret = build2 (C_MAYBE_CONST_EXPR, TREE_TYPE (ret), type_expr, ret);
- C_MAYBE_CONST_EXPR_NON_CONST (ret) = !type_expr_const;
+ C_MAYBE_CONST_EXPR_NON_CONST (ret) = !(type_expr_const
+ && inner_expr_const);
SET_EXPR_LOCATION (ret, loc);
}
+2012-09-14 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/54552
+ * gcc.c-torture/compile/pr54552-1.c: New test.
+
2012-09-14 Marc Glisse <marc.glisse@inria.fr>
PR c++/54427
--- /dev/null
+void
+f (void)
+{
+ unsigned n = 10;
+
+ typedef double T[n];
+ (double (*)[n])((unsigned char (*)[sizeof (T)]){ 0 });
+}