From 891d64721626f45fb95fa47a57a3f396b80f31e9 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 3 Jun 2022 14:53:59 -0400 Subject: 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. --- gcc/testsuite/g++.dg/cpp0x/auto56.C | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/auto56.C diff --git a/gcc/testsuite/g++.dg/cpp0x/auto56.C b/gcc/testsuite/g++.dg/cpp0x/auto56.C new file mode 100644 index 0000000..dd55ebf --- /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 "" } -- cgit v1.1