From ad774d0d6351789e9e412291cf280c8e3f72bf81 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 5 Dec 2019 08:59:24 +0000 Subject: typeck2.c (build_functional_cast): Add location_t parameter and use it. /gcc/cp 2019-12-05 Paolo Carlini * typeck2.c (build_functional_cast): Add location_t parameter and use it. * cp-tree.h: Update declaration. * parser.c (cp_parser_functional_cast): Adjust call. * call.c (build_op_delete_call): Likewise. (build_new_method_call_1): Likewise. * decl.c (check_initializer): Likewise. * pt.c (tsubst_copy_and_build): Likewise. * semantics.c (finish_compound_literal): Likewise. /libcc1 2019-12-05 Paolo Carlini * libcp1plugin.cc (plugin_build_expression_list_expr): Adjust build_functional_cast call. /testsuite 2019-12-05 Paolo Carlini * g++.dg/diagnostic/functional-cast-to-array-type-1.C: New. * g++.dg/cpp0x/auto25.C: Check location(s) too. * g++.dg/cpp0x/auto28.C: Likewise. * g++.dg/init/reference2.C: Likewise. * g++.dg/parse/template2.C: Likewise. * g++.dg/template/error8.C: Likewise. * g++.old-deja/g++.ns/crash3.C: Likewise. * g++.old-deja/g++.ns/template7.C: Likewise. * g++.old-deja/g++.pt/crash8.C: Likewise. From-SVN: r278987 --- gcc/cp/semantics.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/cp/semantics.c') diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 17de39e..83a7891 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2929,7 +2929,8 @@ finish_compound_literal (tree type, tree compound_literal, that it came from T{} rather than T({}). */ CONSTRUCTOR_IS_DIRECT_INIT (compound_literal) = 1; compound_literal = build_tree_list (NULL_TREE, compound_literal); - return build_functional_cast (type, compound_literal, complain); + return build_functional_cast (input_location, type, + compound_literal, complain); } if (TREE_CODE (type) == ARRAY_TYPE -- cgit v1.1