Commit 53943619 by Jason Merrill Committed by Jason Merrill

PR c++/82331 - ICE with variadic partial specialization of auto

	* pt.c (unify) [TEMPLATE_PARM_INDEX]: Set processing_template_decl
	around call to tsubst.

From-SVN: r255430
parent ea9e71de
2017-12-05 Jason Merrill <jason@redhat.com>
PR c++/82331 - ICE with variadic partial specialization of auto
* pt.c (unify) [TEMPLATE_PARM_INDEX]: Set processing_template_decl
around call to tsubst.
2017-12-05 Nathan Sidwell <nathan@acm.org>
PR c++/83287
......
......@@ -20942,7 +20942,9 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
template-parameter exactly, except that a template-argument
deduced from an array bound may be of any integral type.
The non-type parameter might use already deduced type parameters. */
++processing_template_decl;
tparm = tsubst (TREE_TYPE (parm), targs, 0, NULL_TREE);
--processing_template_decl;
if (tree a = type_uses_auto (tparm))
{
tparm = do_auto_deduction (tparm, arg, a, complain, adc_unify);
......
// PR c++/82331
// { dg-options -std=c++17 }
template <auto>
class X;
template <typename R, typename... A, R (*F) (A...)>
class X<F> {
public:
static R call (A... args)
{
return (*F)(args...);
}
};
int func (int a, int b) { return a + b; }
int test () { return X<&func>::call(1, 2); }
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