Commit 950b198d by Jason Merrill Committed by Jason Merrill

PR c++/89966 - error with non-type auto tparm.

My patch for PR 86932 broke this testcase by passing tf_partial to
coerce_template_template_parms, which prevented do_auto_deduction from
actually replacing the auto.

	* pt.c (do_auto_deduction): Clear tf_partial.

From-SVN: r270160
parent 17838af9
2019-04-04 Jason Merrill <jason@redhat.com> 2019-04-04 Jason Merrill <jason@redhat.com>
PR c++/89966 - error with non-type auto tparm.
* pt.c (do_auto_deduction): Clear tf_partial.
2019-04-04 Jason Merrill <jason@redhat.com>
PR c++/86986 - ICE with TTP with parameter pack. PR c++/86986 - ICE with TTP with parameter pack.
* pt.c (coerce_template_parameter_pack): Only look at the type of a * pt.c (coerce_template_parameter_pack): Only look at the type of a
non-type parameter pack. non-type parameter pack.
......
...@@ -27504,6 +27504,10 @@ do_auto_deduction (tree type, tree init, tree auto_node, ...@@ -27504,6 +27504,10 @@ do_auto_deduction (tree type, tree init, tree auto_node,
if (init && undeduced_auto_decl (init)) if (init && undeduced_auto_decl (init))
return type; return type;
/* We may be doing a partial substitution, but we still want to replace
auto_node. */
complain &= ~tf_partial;
if (tree tmpl = CLASS_PLACEHOLDER_TEMPLATE (auto_node)) if (tree tmpl = CLASS_PLACEHOLDER_TEMPLATE (auto_node))
/* C++17 class template argument deduction. */ /* C++17 class template argument deduction. */
return do_class_deduction (type, tmpl, init, flags, complain); return do_class_deduction (type, tmpl, init, flags, complain);
......
// PR c++/89966
// { dg-do compile { target c++17 } }
template < auto a0 >
void f0() { }
void f0_call() { f0< sizeof(int) >(); }
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