Commit a68329c2 by Jason Merrill Committed by Jason Merrill

re PR c++/56388 (catch(...) in lambda rejected)

	PR c++/56388
	* semantics.c (insert_capture_proxy): Just use index 1 in the
	stmt_list_stack.

From-SVN: r197981
parent 7b8265ba
2013-04-15 Jason Merrill <jason@redhat.com>
PR c++/56388
* semantics.c (insert_capture_proxy): Just use index 1 in the
stmt_list_stack.
2013-04-12 Jakub Jelinek <jakub@redhat.com>
* error.c (cp_print_error_function,
......
......@@ -9265,13 +9265,12 @@ void
insert_capture_proxy (tree var)
{
cp_binding_level *b;
int skip;
tree stmt_list;
/* Put the capture proxy in the extra body block so that it won't clash
with a later local variable. */
b = current_binding_level;
for (skip = 0; ; ++skip)
for (;;)
{
cp_binding_level *n = b->level_chain;
if (n->kind == sk_function_parms)
......@@ -9282,7 +9281,7 @@ insert_capture_proxy (tree var)
/* And put a DECL_EXPR in the STATEMENT_LIST for the same block. */
var = build_stmt (DECL_SOURCE_LOCATION (var), DECL_EXPR, var);
stmt_list = (*stmt_list_stack)[stmt_list_stack->length () - 1 - skip];
stmt_list = (*stmt_list_stack)[1];
gcc_assert (stmt_list);
append_to_statement_list_force (var, &stmt_list);
}
......
// PR c++/56388
// { dg-require-effective-target c++11 }
int main()
{
bool /*const*/ condition = false;
[&]{
try{}
catch(...){
if(condition){}
}
}();
}
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