aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-08-07 15:48:30 -0400
committerJason Merrill <jason@gcc.gnu.org>2014-08-07 15:48:30 -0400
commit2e8e74c0ad0110732111082eb48deed18b66221d (patch)
treef24f43aa8bdf5341497ccecdba62f97d103406fd /gcc/cp/semantics.c
parent34c1359ee150a881d2d3df46687a975aef5538ad (diff)
downloadgcc-2e8e74c0ad0110732111082eb48deed18b66221d.zip
gcc-2e8e74c0ad0110732111082eb48deed18b66221d.tar.gz
gcc-2e8e74c0ad0110732111082eb48deed18b66221d.tar.bz2
re PR c++/61959 (ICE: in tree_to_uhwi, at tree.h:3657 when building Mozilla code)
PR c++/61959 * semantics.c (cxx_eval_bare_aggregate): Handle POINTER_PLUS_EXPR. From-SVN: r213731
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 536ea5c..4cd9bee 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -8977,7 +8977,9 @@ cxx_eval_bare_aggregate (const constexpr_call *call, tree t,
constructor_elt *inner = base_field_constructor_elt (n, ce->index);
inner->value = elt;
}
- else if (ce->index && TREE_CODE (ce->index) == NOP_EXPR)
+ else if (ce->index
+ && (TREE_CODE (ce->index) == NOP_EXPR
+ || TREE_CODE (ce->index) == POINTER_PLUS_EXPR))
{
/* This is an initializer for an empty base; now that we've
checked that it's constant, we can ignore it. */