From b423f98bea608d8d2fe0f355c7db2b44e85e0c4e Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 30 Jun 2017 18:46:01 +0000 Subject: * config-lang.in (gtfiles): Add cp/lex.c. * cp-tree.h (mangle_convop_name_for_type): Rename ... (make_conv_op_name): ... here. Move to lex. * lambda.c (maybe_add_lambda_conv_op): Update. * parser.c (cp_parser_conversion_function_id): Update. * pt.c (tsubst_decl, tsubst_baselink, tsubst_copy, tsubst_copy_and_build): Update. * semantics.c (apply_deduced_return_type): Update. * mangle.c (conv_type_hasher, conv_type_names, mangle_conv_op_name_for_type): Move to ... * lex.c (conv_type_hasher, conv_type_names, make_convop_name): ... here. Rename. * libcp1plugin.cc (plugin_build_decl): Use make_conv_op_name. (plugin_build_dependent_expr): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249852 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/lambda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/cp/lambda.c') diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 41d4921c1db..0e02375fa1b 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -1088,7 +1088,7 @@ maybe_add_lambda_conv_op (tree type) /* First build up the conversion op. */ tree rettype = build_pointer_type (stattype); - tree name = mangle_conv_op_name_for_type (rettype); + tree name = make_conv_op_name (rettype); tree thistype = cp_build_qualified_type (type, TYPE_QUAL_CONST); tree fntype = build_method_type_directly (thistype, rettype, void_list_node); tree convfn = build_lang_decl (FUNCTION_DECL, name, fntype); -- cgit v1.2.1 From c8766acfc70d4e15ae67c1bf20afc8037b78ab95 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 26 Jul 2017 21:46:22 +0000 Subject: /cp 2017-07-26 Paolo Carlini PR c++/71570 * lambda.c (add_capture): Early return if we cannot capture by reference. /testsuite 2017-07-26 Paolo Carlini PR c++/71570 * g++.dg/cpp0x/lambda/lambda-ice17.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250591 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/lambda.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/cp/lambda.c') diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 0e02375fa1b..14ff6c2ae43 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -529,7 +529,10 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p, else if (id != this_identifier && by_reference_p) { if (!lvalue_p (initializer)) - error ("cannot capture %qE by reference", initializer); + { + error ("cannot capture %qE by reference", initializer); + return error_mark_node; + } } else { -- cgit v1.2.1