summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ab00a0f12ff..7167992ae16 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 3d62cd19306..558be885275 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)