aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-11-04 16:31:31 -0400
committerJason Merrill <jason@gcc.gnu.org>2010-11-04 16:31:31 -0400
commitd4e55f308ea4309fcf10008224e892e40f835c1d (patch)
tree06de971fa644127c217977136a84493d159da4e2 /gcc/cp
parent58082ff61616ea33c317d9e9058dd8e644d04274 (diff)
downloadgcc-d4e55f308ea4309fcf10008224e892e40f835c1d.zip
gcc-d4e55f308ea4309fcf10008224e892e40f835c1d.tar.gz
gcc-d4e55f308ea4309fcf10008224e892e40f835c1d.tar.bz2
re PR c++/46298 (constexpr ICE on ARM)
PR c++/46298 * semantics.c (build_constexpr_constructor_member_initializers): Handle an enclosing STATEMENT_LIST. From-SVN: r166330
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/semantics.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ab00a0f..7167992 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2010-11-04 Jason Merrill <jason@redhat.com>
+ PR c++/46298
+ * semantics.c (build_constexpr_constructor_member_initializers):
+ Handle an enclosing STATEMENT_LIST.
+
* semantics.c (speculative_access_check): New.
* cp-tree.h: Declare it.
* call.c (build_over_call): Use it.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 3d62cd1..558be88 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5535,8 +5535,9 @@ build_constexpr_constructor_member_initializers (tree type, tree body)
if (TREE_CODE (body) == MUST_NOT_THROW_EXPR
|| TREE_CODE (body) == EH_SPEC_BLOCK)
body = TREE_OPERAND (body, 0);
- if (TREE_CODE (body) == BIND_EXPR)
- body = BIND_EXPR_BODY (body);
+ if (TREE_CODE (body) == STATEMENT_LIST)
+ body = STATEMENT_LIST_HEAD (body)->stmt;
+ body = BIND_EXPR_BODY (body);
if (TREE_CODE (body) == CLEANUP_POINT_EXPR)
ok = build_data_member_initialization (body, &vec);
else if (TREE_CODE (body) == STATEMENT_LIST)