blob: 8999f6e6d5b41483bbd9381eb3c67ed4caf648b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
Index: gcc/testsuite/g++.dg/cpp1y/auto-fn47.C
===================================================================
--- gcc/testsuite/g++.dg/cpp1y/auto-fn47.C (nonexistent)
+++ gcc/testsuite/g++.dg/cpp1y/auto-fn47.C (revision 257630)
@@ -0,0 +1,6 @@
+// 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" }
Index: gcc/cp/pt.c
===================================================================
--- gcc/cp/pt.c (revision 257629)
+++ gcc/cp/pt.c (revision 257630)
@@ -2203,6 +2203,11 @@
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))
|