diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-10-21 20:51:43 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-10-21 20:51:43 +0200 |
commit | 5b884e9400741569ee385f0de4590c1730aa600c (patch) | |
tree | 165246beafb86b08de2359aba199728f9d7aa285 /gcc/cp/constexpr.c | |
parent | afa8c090bf5ee17d89628b4885efad3a7ea62505 (diff) | |
download | gcc-5b884e9400741569ee385f0de4590c1730aa600c.zip gcc-5b884e9400741569ee385f0de4590c1730aa600c.tar.gz gcc-5b884e9400741569ee385f0de4590c1730aa600c.tar.bz2 |
re PR c++/92015 (internal compiler error: in cxx_eval_array_reference, at cp/constexpr.c:2568)
PR c++/92015
* constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref):
Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts.
* g++.dg/cpp0x/constexpr-92015.C: New test.
From-SVN: r277267
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r-- | gcc/cp/constexpr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 46d41ec..60d4b9a 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -2887,7 +2887,10 @@ cxx_eval_component_reference (const constexpr_ctx *ctx, tree t, : field == part) { if (value) - return value; + { + STRIP_ANY_LOCATION_WRAPPER (value); + return value; + } else /* We're in the middle of initializing it. */ break; @@ -2977,6 +2980,7 @@ cxx_eval_bit_field_ref (const constexpr_ctx *ctx, tree t, FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (whole), i, field, value) { tree bitpos = bit_position (field); + STRIP_ANY_LOCATION_WRAPPER (value); if (bitpos == start && DECL_SIZE (field) == TREE_OPERAND (t, 1)) return value; if (TREE_CODE (TREE_TYPE (field)) == INTEGER_TYPE |