Commit e62e4922 by Jason Merrill Committed by Jason Merrill

re PR c++/43641 ([C++0x] internal compiler error: tree check: expected…

re PR c++/43641 ([C++0x] internal compiler error: tree check: expected call_expr, have target_expr in maybe_add_lambda_conv_op)

	PR c++/43641
	* semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
	return value directly.

From-SVN: r158241
parent d6850483
2010-04-12 Jason Merrill <jason@redhat.com> 2010-04-12 Jason Merrill <jason@redhat.com>
PR c++/43641
* semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
return value directly.
* call.c (type_decays_to): Call cv_unqualified for non-class type. * call.c (type_decays_to): Call cv_unqualified for non-class type.
2010-04-12 Fabien Chene <fabien.chene@gmail.com> 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
......
...@@ -5968,9 +5968,12 @@ maybe_add_lambda_conv_op (tree type) ...@@ -5968,9 +5968,12 @@ maybe_add_lambda_conv_op (tree type)
VEC_quick_push (tree, argvec, arg); VEC_quick_push (tree, argvec, arg);
for (arg = DECL_ARGUMENTS (statfn); arg; arg = TREE_CHAIN (arg)) for (arg = DECL_ARGUMENTS (statfn); arg; arg = TREE_CHAIN (arg))
VEC_safe_push (tree, gc, argvec, arg); VEC_safe_push (tree, gc, argvec, arg);
call = build_cxx_call (callop, VEC_length (tree, argvec), call = build_call_a (callop, VEC_length (tree, argvec),
VEC_address (tree, argvec)); VEC_address (tree, argvec));
CALL_FROM_THUNK_P (call) = 1; CALL_FROM_THUNK_P (call) = 1;
if (MAYBE_CLASS_TYPE_P (TREE_TYPE (call)))
call = build_cplus_new (TREE_TYPE (call), call);
call = convert_from_reference (call);
finish_return_stmt (call); finish_return_stmt (call);
finish_compound_stmt (compound_stmt); finish_compound_stmt (compound_stmt);
......
2010-04-12 Jason Merrill <jason@redhat.com> 2010-04-12 Jason Merrill <jason@redhat.com>
PR c++/43641
* g++.dg/cpp0x/lambda/lambda-conv4.C: New.
* g++.dg/cpp0x/lambda/lambda-deduce2.C: New. * g++.dg/cpp0x/lambda/lambda-deduce2.C: New.
2010-04-12 Fabien Chene <fabien.chene@gmail.com> 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
......
// PR c++/43641
// { dg-options "-std=c++0x" }
struct B
{
int i;
};
void func()
{
[](const B& b) -> const int& { return b.i; };
[](const B& b) { return b; };
}
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