Commit 30ac6e80 by Jason Merrill Committed by Jason Merrill

re PR c++/65973 (segmentation fault when compiling C++14 code)

	PR c++/65973
	* constexpr.c (build_constexpr_constructor_member_initializers):
	Handle an empty STATEMENT_LIST.

From-SVN: r224677
parent 892562cf
2015-06-19 Jason Merrill <jason@redhat.com> 2015-06-19 Jason Merrill <jason@redhat.com>
PR c++/65973
* constexpr.c (build_constexpr_constructor_member_initializers):
Handle an empty STATEMENT_LIST.
PR c++/65843 PR c++/65843
* pt.c (tsubst_copy_and_build): Register a capture proxy in * pt.c (tsubst_copy_and_build): Register a capture proxy in
local_specializations. local_specializations.
......
...@@ -537,16 +537,16 @@ build_constexpr_constructor_member_initializers (tree type, tree body) ...@@ -537,16 +537,16 @@ build_constexpr_constructor_member_initializers (tree type, tree body)
body = TREE_OPERAND (body, 0); body = TREE_OPERAND (body, 0);
if (TREE_CODE (body) == STATEMENT_LIST) if (TREE_CODE (body) == STATEMENT_LIST)
{ {
tree_stmt_iterator i = tsi_start (body); for (tree_stmt_iterator i = tsi_start (body);
while (true) !tsi_end_p (i); tsi_next (&i))
{ {
body = tsi_stmt (i); body = tsi_stmt (i);
if (TREE_CODE (body) == BIND_EXPR) if (TREE_CODE (body) == BIND_EXPR)
break; break;
tsi_next (&i);
} }
} }
body = BIND_EXPR_BODY (body); if (TREE_CODE (body) == BIND_EXPR)
body = BIND_EXPR_BODY (body);
if (TREE_CODE (body) == CLEANUP_POINT_EXPR) if (TREE_CODE (body) == CLEANUP_POINT_EXPR)
{ {
body = TREE_OPERAND (body, 0); body = TREE_OPERAND (body, 0);
......
// PR c++/65973
// { dg-do compile { target c++14 } }
class foo {
constexpr foo() noexcept { __func__; };
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment