PR c++/71822
* cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
fold *expr_p before genericizing it.
* g++.dg/template/defarg21.C: New test.
From-SVN: r238440
2016-07-18 Jakub Jelinek <jakub@redhat.com>
+ PR c++/71822
+ * cp-gimplify.c (cp_gimplify_expr) <case VEC_INIT_EXPR>: Recursively
+ fold *expr_p before genericizing it.
+
PR c++/71871
* typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
init, VEC_INIT_EXPR_VALUE_INIT (*expr_p),
from_array,
tf_warning_or_error);
+ hash_set<tree> pset;
+ cp_walk_tree (expr_p, cp_fold_r, &pset, NULL);
cp_genericize_tree (expr_p);
ret = GS_OK;
input_location = loc;
2016-07-18 Jakub Jelinek <jakub@redhat.com>
+ PR c++/71822
+ * g++.dg/template/defarg21.C: New test.
+
PR c++/71871
* g++.dg/ext/vector31.C: New test.
--- /dev/null
+// PR c++/71822
+// { dg-do compile }
+
+int bar (int);
+
+template <typename T>
+struct A
+{
+ explicit A (int x = bar (sizeof (T)));
+};
+
+struct B
+{
+ A <int> b[2];
+};
+
+void
+baz ()
+{
+ B b;
+}