public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-987] c++: more-specialized test
@ 2022-06-03 21:04 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-06-03 21:04 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:891d64721626f45fb95fa47a57a3f396b80f31e9
commit r13-987-g891d64721626f45fb95fa47a57a3f396b80f31e9
Author: Jason Merrill <jason@redhat.com>
Date: Fri Jun 3 14:53:59 2022 -0400
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:
---
gcc/testsuite/g++.dg/cpp0x/auto56.C | 6 ++++++
1 file changed, 6 insertions(+)
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 <class T> T f(T);
+template <class T> T* f(T*);
+auto p = &f<int>; // { dg-error "" }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-03 21:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 21:04 [gcc r13-987] c++: more-specialized test Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).