]> gcc.gnu.org Git - gcc.git/commitdiff
c++: more-specialized test
authorJason Merrill <jason@redhat.com>
Fri, 3 Jun 2022 18:53:59 +0000 (14:53 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 3 Jun 2022 21:04:30 +0000 (17:04 -0400)
I noticed the need for this testcase while working on PR102629; since there
is no information about the target type, we don't want to choose the most
specialized overload.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/auto56.C: New test.

gcc/testsuite/g++.dg/cpp0x/auto56.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp0x/auto56.C b/gcc/testsuite/g++.dg/cpp0x/auto56.C
new file mode 100644 (file)
index 0000000..dd55ebf
--- /dev/null
@@ -0,0 +1,6 @@
+// Check that we don't prefer #2 because it's more specialized.
+// { dg-do compile { target c++11 } }
+
+template <class T> T f(T);
+template <class T> T* f(T*);
+auto p = &f<int>;              // { dg-error "" }
This page took 0.065764 seconds and 5 git commands to generate.