summaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-23 22:29:53 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-23 22:29:53 +0000
commit43936711fc72dbea643334f250f055f85f398fa2 (patch)
treefdde8455ca7ffe4a47159148d311a462aca7e170 /gcc/cp/parser.c
parentd0691b8b452818c49dc5277d5a39a475fc015b87 (diff)
downloadgcc-43936711fc72dbea643334f250f055f85f398fa2.tar.gz
Make lambda conversion op and op() non-static.
* semantics.c (maybe_add_lambda_conv_op): Make non-static. Also add the thunk function returned by the conversion op. Mark the conversion deleted if the op() is variadic. * decl2.c (mark_used): Give helpful message about deleted conversion. * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static. * semantics.c (finish_this_expr): Adjust. * mangle.c (write_closure_type_name): Adjust. * decl.c (grok_op_properties): Don't allow it. * call.c (build_user_type_conversion_1): No static conversion ops. (build_op_call): Or op(). * decl2.c (change_return_type): Fix 'this' quals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157681 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d27d12254ca..cbbfd94938d 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -7390,18 +7390,8 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr)
declarator = make_id_declarator (NULL_TREE, ansi_opname (CALL_EXPR),
sfk_none);
- quals = TYPE_UNQUALIFIED;
- if (LAMBDA_EXPR_CAPTURE_LIST (lambda_expr) == NULL_TREE
- && LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (lambda_expr) == CPLD_NONE)
- {
- /* A lambda with no captures has a static op() and a conversion op
- to function type. */
- if (LAMBDA_EXPR_MUTABLE_P (lambda_expr))
- error ("lambda expression with no captures declared mutable");
- return_type_specs.storage_class = sc_static;
- }
- else if (!LAMBDA_EXPR_MUTABLE_P (lambda_expr))
- quals = TYPE_QUAL_CONST;
+ quals = (LAMBDA_EXPR_MUTABLE_P (lambda_expr)
+ ? TYPE_UNQUALIFIED : TYPE_QUAL_CONST);
declarator = make_call_declarator (declarator, param_list, quals,
exception_spec,
/*late_return_type=*/NULL_TREE);