PR c++/87934
* constexpr.c (cxx_eval_constant_expression) <case CONSTRUCTOR>: Do
re-process TREE_CONSTANT CONSTRUCTORs if they aren't reduced constant
expressions.
* g++.dg/cpp0x/constexpr-87934.C: New test.
From-SVN: r267253
+2018-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/87934
+ * constexpr.c (cxx_eval_constant_expression) <case CONSTRUCTOR>: Do
+ re-process TREE_CONSTANT CONSTRUCTORs if they aren't reduced constant
+ expressions.
+
2018-12-19 Alexandre Oliva <aoliva@redhat.com>
PR c++/87012
break;
case CONSTRUCTOR:
- if (TREE_CONSTANT (t))
+ if (TREE_CONSTANT (t) && reduced_constant_expression_p (t))
{
/* Don't re-process a constant CONSTRUCTOR, but do fold it to
VECTOR_CST if applicable. */
+2018-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/87934
+ * g++.dg/cpp0x/constexpr-87934.C: New test.
+
2018-12-19 Alexandre Oliva <aoliva@redhat.com>
PR testsuite/86153
--- /dev/null
+// PR c++/87934
+// { dg-do compile { target c++11 } }
+
+struct Foo
+{
+ enum { BAR } bar = BAR;
+};
+
+constexpr Foo foo{};