OSDN Git Service

Allow no-capture lambdas to convert to function pointer.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Oct 2009 21:58:09 +0000 (21:58 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Oct 2009 21:58:09 +0000 (21:58 +0000)
commit91a733f97f879e50ec17dea55200c6d630d75cd3
tree000402686698d1995b0a51ccb183ff709533ba84
parenteb98f615b8c7a1b60815c969f552ea7d6d701c56
Allow no-capture lambdas to convert to function pointer.
* semantics.c (maybe_add_lambda_conv_op): New.
* parser.c (cp_parser_lambda_expression): Call it.
(cp_parser_lambda_declarator_opt): Make op() static if
no captures.
* mangle.c (write_closure_type_name): Adjust.
* semantics.c (finish_this_expr): Adjust.
* decl.c (grok_op_properties): Allow it.
* call.c (build_user_type_conversion_1): Handle static conversion op.
(build_op_call): And op().

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153617 138bc75d-0d04-0410-961f-82ee72b054a4
13 files changed:
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/mangle.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const-neg.C
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C