From 9fb82e652cee118b5c9d77e1e60a351a37a55dc8 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 9 Aug 2017 14:32:02 -0400 Subject: PR c++/81359 - Unparsed NSDMI error from SFINAE context. * init.c (get_nsdmi): Add complain parm. * typeck2.c (digest_nsdmi_init): Add complain parm. (process_init_constructor_record): Pass complain to get_nsdmi. * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool. * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into synthesized_method_walk. (synthesized_method_walk): Adjust. (walk_field_subobs): Pass complain to get_nsdmi. (defaulted_late_check): Skip other checks if deleted. * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept. * call.c (build_aggr_conv): Pass complain to get_nsdmi. * parser.c (defarg_location): New. * error.c (location_of): Use it. From-SVN: r250994 --- gcc/cp/typeck2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gcc/cp/typeck2.c') diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 430ba30..06c079e 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1182,7 +1182,7 @@ digest_init_flags (tree type, tree init, int flags, tsubst_flags_t complain) /* Process the initializer INIT for an NSDMI DECL (a FIELD_DECL). */ tree -digest_nsdmi_init (tree decl, tree init) +digest_nsdmi_init (tree decl, tree init, tsubst_flags_t complain) { gcc_assert (TREE_CODE (decl) == FIELD_DECL); @@ -1192,8 +1192,8 @@ digest_nsdmi_init (tree decl, tree init) flags = LOOKUP_NORMAL; if (BRACE_ENCLOSED_INITIALIZER_P (init) && CP_AGGREGATE_TYPE_P (type)) - init = reshape_init (type, init, tf_warning_or_error); - init = digest_init_flags (type, init, flags, tf_warning_or_error); + init = reshape_init (type, init, complain); + init = digest_init_flags (type, init, flags, complain); if (TREE_CODE (init) == TARGET_EXPR) /* This represents the whole initialization. */ TARGET_EXPR_DIRECT_INIT_P (init) = true; @@ -1427,7 +1427,7 @@ process_init_constructor_record (tree type, tree init, goto restart; } /* C++14 aggregate NSDMI. */ - next = get_nsdmi (field, /*ctor*/false); + next = get_nsdmi (field, /*ctor*/false, complain); } else if (type_build_ctor_call (TREE_TYPE (field))) { @@ -1525,7 +1525,8 @@ process_init_constructor_union (tree type, tree init, { CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (init), field, - get_nsdmi (field, /*in_ctor=*/false)); + get_nsdmi (field, /*in_ctor=*/false, + complain)); break; } } -- cgit v1.1