Commit 99be38ec by Jason Merrill Committed by Jason Merrill

PR c++/79294 - ICE with invalid template argument

	* pt.c (convert_nontype_argument_function): Check value-dependence.
	(convert_nontype_argument): Don't check it here for function ptrs.

From-SVN: r245168
parent 10613537
2017-02-03 Jason Merrill <jason@redhat.com>
PR c++/79294 - ICE with invalid template argument
* pt.c (convert_nontype_argument_function): Check value-dependence.
(convert_nontype_argument): Don't check it here for function ptrs.
2017-02-02 Richard Biener <rguenther@suse.de>
PR cp/14179
......
......@@ -5966,6 +5966,9 @@ convert_nontype_argument_function (tree type, tree expr,
if (fn == error_mark_node)
return error_mark_node;
if (value_dependent_expression_p (fn))
return fn;
fn_no_ptr = strip_fnptr_conv (fn);
if (TREE_CODE (fn_no_ptr) == ADDR_EXPR)
fn_no_ptr = TREE_OPERAND (fn_no_ptr, 0);
......@@ -6698,8 +6701,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
/* Null pointer values are OK in C++11. */
return perform_qualification_conversions (type, expr);
if (!value_dependent_expression_p (expr))
expr = convert_nontype_argument_function (type, expr, complain);
expr = convert_nontype_argument_function (type, expr, complain);
if (!expr || expr == error_mark_node)
return expr;
}
......@@ -6723,8 +6725,7 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
return NULL_TREE;
}
if (!value_dependent_expression_p (expr))
expr = convert_nontype_argument_function (type, expr, complain);
expr = convert_nontype_argument_function (type, expr, complain);
if (!expr || expr == error_mark_node)
return expr;
}
......
// PR c++/79294
template <int()> struct a;
template <int(b)> a < b // { dg-error "int" }
// { dg-error "expected" "" { target *-*-* } .-1 }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment