aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-12-19 09:11:40 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-12-19 09:11:40 +0100
commit35d87f01947ab873477d72380b84d8b70659b541 (patch)
tree1bd659fb7398aa8a5047a9eb2f910c2850b293de /gcc/cp/constexpr.c
parent0d3d674bcb173e8d694715c1e4fa24937cccc0f3 (diff)
downloadgcc-35d87f01947ab873477d72380b84d8b70659b541.zip
gcc-35d87f01947ab873477d72380b84d8b70659b541.tar.gz
gcc-35d87f01947ab873477d72380b84d8b70659b541.tar.bz2
re PR c++/87934 (struct with NSDMI of enum makes initialization a non-constant expression)
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
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r--gcc/cp/constexpr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index f804946..79df70e 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -4681,7 +4681,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
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. */