aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/typeck2.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2017-08-09 14:32:02 -0400
committerJason Merrill <jason@gcc.gnu.org>2017-08-09 14:32:02 -0400
commit9fb82e652cee118b5c9d77e1e60a351a37a55dc8 (patch)
tree1ff0784160f8c2d88777310405e7581704bfedb3 /gcc/cp/typeck2.c
parent04d07b61cb80fd97e98eb39451ff6a8675a63d90 (diff)
downloadgcc-9fb82e652cee118b5c9d77e1e60a351a37a55dc8.zip
gcc-9fb82e652cee118b5c9d77e1e60a351a37a55dc8.tar.gz
gcc-9fb82e652cee118b5c9d77e1e60a351a37a55dc8.tar.bz2
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
Diffstat (limited to 'gcc/cp/typeck2.c')
-rw-r--r--gcc/cp/typeck2.c11
1 files changed, 6 insertions, 5 deletions
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;
}
}