c++: ICE with ptr_plus_expr

An ICE on darwin, when a SFINAE-context substitution produced
error_mark_node foo an operand of a POINTER_PLUS_EXPR.
fold_build_pointer_plus is unprepared to deal with that, so we need to
check earlier.  We had no luck reducing the testcase to something
manageable.

	* pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
	error_mark_node.
This commit is contained in:
Nathan Sidwell 2020-04-21 06:46:42 -07:00
parent 15256c8a8a
commit f2c8be187e
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2020-04-21 Nathan Sidwell <nathan@acm.org>
* pt.c (tsubst_copy_and_build) [POINTER_PLUS_EXPR]: Check for
error_mark_node.
2020-04-21 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94661
@ -38,13 +43,13 @@
2020-04-20 Nathan Sidwell <nathan@acm.org>
PR 94454 - tpl-tpl-parms are not canonicalizable types
PR c++/94454 - tpl-tpl-parms are not canonicalizable types
* pt.c (canonical_type_parameter): Assert not a tpl-tpl-parm.
(process_template_parm): tpl-tpl-parms are structural.
(rewrite_template_parm): Propagate structuralness.
PR 94454 - Expr pack expansion equality
* tree.c (cp_tree_equal): [TEMPLATE_ID_EXPR, default] Refactor.
PR c++/94454 - Expr pack expansion equality
* tree.c (cp_tree_equal) [TEMPLATE_ID_EXPR, default]: Refactor.
[EXPR_PACK_EXPANSION]: Add.
PR c++/94454 Template Argument Hashing

View File

@ -19409,7 +19409,11 @@ tsubst_copy_and_build (tree t,
case POINTER_PLUS_EXPR:
{
tree op0 = RECUR (TREE_OPERAND (t, 0));
if (op0 == error_mark_node)
RETURN (error_mark_node);
tree op1 = RECUR (TREE_OPERAND (t, 1));
if (op1 == error_mark_node)
RETURN (error_mark_node);
RETURN (fold_build_pointer_plus (op0, op1));
}