diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-12-19 09:11:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-12-19 09:11:40 +0100 |
commit | 35d87f01947ab873477d72380b84d8b70659b541 (patch) | |
tree | 1bd659fb7398aa8a5047a9eb2f910c2850b293de /gcc/cp/constexpr.c | |
parent | 0d3d674bcb173e8d694715c1e4fa24937cccc0f3 (diff) | |
download | gcc-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.c | 2 |
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. */ |