Commit 9ef86762 by Jason Merrill Committed by Jason Merrill

PR c++/84080 - ICE with return type deduction and specialization.

	* pt.c (determine_specialization): Check uses_template_parms.

From-SVN: r257630
parent ff67aff4
2018-02-13 Jason Merrill <jason@redhat.com>
PR c++/84080 - ICE with return type deduction and specialization.
* pt.c (determine_specialization): Check uses_template_parms.
Fix more variadic capture issues.
* pt.c (find_parameter_packs_r): Also look at explicit captures.
(check_for_bare_parameter_packs): Check current_class_type for
......
......@@ -2203,6 +2203,11 @@ determine_specialization (tree template_id,
specialize TMPL will produce DECL. */
continue;
if (uses_template_parms (targs))
/* We deduced something involving 'auto', which isn't a valid
template argument. */
continue;
/* Remove, from the set of candidates, all those functions
whose constraints are not satisfied. */
if (flag_concepts && !constraints_satisfied_p (fn, targs))
......
// PR c++/84080
// { dg-do compile { target c++14 } }
template <int i, typename T> T foo();
template <> auto foo<0>() { return 42; } // { dg-error "does not match" }
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