aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2017-08-29 15:39:18 -0400
committerJason Merrill <jason@gcc.gnu.org>2017-08-29 15:39:18 -0400
commit1aeafba210c4796bde79d4d06e05c96a153b8fb5 (patch)
tree8d6bd959531218d3f5f3c7303607ecfb61291bde /gcc/cp
parenta2aa807ef9537ab75e81dd0470e90f5a54d75031 (diff)
downloadgcc-1aeafba210c4796bde79d4d06e05c96a153b8fb5.zip
gcc-1aeafba210c4796bde79d4d06e05c96a153b8fb5.tar.gz
gcc-1aeafba210c4796bde79d4d06e05c96a153b8fb5.tar.bz2
Fix default argument conversion failure and SFINAE.
* call.c (build_over_call): Check convert_default_arg result for error_mark_node. * parser.c (cp_parser_late_parsing_default_args): Remember error_mark_node. From-SVN: r251421
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/call.c11
-rw-r--r--gcc/cp/parser.c5
3 files changed, 15 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 37ae6ea..fc244a1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2017-08-29 Jason Merrill <jason@redhat.com>
+
+ Fix default argument conversion failure and SFINAE.
+ * call.c (build_over_call): Check convert_default_arg result for
+ error_mark_node.
+ * parser.c (cp_parser_late_parsing_default_args): Remember
+ error_mark_node.
+
2017-08-28 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (lang_type): Replace sorted_fields vector with
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 067db59a..6405be2 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7892,10 +7892,13 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
{
if (TREE_VALUE (parm) == error_mark_node)
return error_mark_node;
- argarray[j++] = convert_default_arg (TREE_VALUE (parm),
- TREE_PURPOSE (parm),
- fn, i - is_method,
- complain);
+ val = convert_default_arg (TREE_VALUE (parm),
+ TREE_PURPOSE (parm),
+ fn, i - is_method,
+ complain);
+ if (val == error_mark_node)
+ return error_mark_node;
+ argarray[j++] = val;
}
/* Ellipsis */
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index b849824..9b7c2c0 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -27645,11 +27645,6 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
= cp_parser_late_parse_one_default_arg (parser, parmdecl,
default_arg,
TREE_VALUE (parm));
- if (parsed_arg == error_mark_node)
- {
- continue;
- }
-
TREE_PURPOSE (parm) = parsed_arg;
/* Update any instantiations we've already created. */