PR c++/64603
* constexpr.c (cxx_eval_constant_expression): Only shortcut
constant CONSTRUCTORs.
From-SVN: r219973
2015-01-21 Jason Merrill <jason@redhat.com>
+ PR c++/64603
+ * constexpr.c (cxx_eval_constant_expression): Only shortcut
+ constant CONSTRUCTORs.
+
PR c++/64647
* constexpr.c (ensure_literal_type_for_constexpr_object): Don't
give a hard error in a template instantiation.
*overflow_p = true;
return t;
}
- if (TREE_CODE (t) != NOP_EXPR
- && reduced_constant_expression_p (t))
- return fold (t);
switch (TREE_CODE (t))
{
break;
case CONSTRUCTOR:
+ if (TREE_CONSTANT (t))
+ /* Don't re-process a constant CONSTRUCTOR, but do fold it to
+ VECTOR_CST if applicable. */
+ return fold (t);
r = cxx_eval_bare_aggregate (ctx, t, lval,
non_constant_p, overflow_p);
break;
--- /dev/null
+// PR c++/64603
+// { dg-do compile { target c++11 } }
+
+template <int i> constexpr int find_longest_name()
+{
+ return sizeof("Main") - 1;
+}
+
+template <int i, int l = find_longest_name<i>()> void create_all_loggers()
+{}
+
+int main()
+{
+ create_all_loggers<1>();
+}