From: Jason Merrill Date: Fri, 3 Jun 2022 18:53:59 +0000 (-0400) Subject: c++: more-specialized test X-Git-Tag: basepoints/gcc-14~6220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=891d64721626f45fb95fa47a57a3f396b80f31e9;p=thirdparty%2Fgcc.git c++: more-specialized test 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. --- diff --git a/gcc/testsuite/g++.dg/cpp0x/auto56.C b/gcc/testsuite/g++.dg/cpp0x/auto56.C new file mode 100644 index 00000000000..dd55ebfb9c0 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/auto56.C @@ -0,0 +1,6 @@ +// Check that we don't prefer #2 because it's more specialized. +// { dg-do compile { target c++11 } } + +template T f(T); +template T* f(T*); +auto p = &f; // { dg-error "" }