public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7109] c++: Add testcase for already fixed PR [PR104425]
@ 2022-02-08 14:49 Patrick Palka
0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2022-02-08 14:49 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:be862bf1f612c884597ace4cbfdec972a0bf0eef
commit r12-7109-gbe862bf1f612c884597ace4cbfdec972a0bf0eef
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Feb 8 09:47:34 2022 -0500
c++: Add testcase for already fixed PR [PR104425]
Fixed by r12-1829.
PR c++/104425
gcc/testsuite/ChangeLog:
* g++.dg/template/partial-specialization10.C: New test.
Diff:
---
.../g++.dg/template/partial-specialization10.C | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/gcc/testsuite/g++.dg/template/partial-specialization10.C b/gcc/testsuite/g++.dg/template/partial-specialization10.C
new file mode 100644
index 00000000000..d03f313745b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/partial-specialization10.C
@@ -0,0 +1,25 @@
+// PR c++/104425
+// { dg-do compile { target c++11 } }
+
+namespace A { class foo {}; }
+namespace B { class bar {}; }
+
+A::foo& operator<<(A::foo& f, const B::bar&);
+
+namespace C {
+ template<class T> T val();
+
+ A::foo& operator<<(A::foo& f, int in);
+
+ template<class T, class = void>
+ struct has_insertion_operator {
+ static constexpr bool value = false;
+ };
+
+ template<class T>
+ struct has_insertion_operator<T, decltype(val<A::foo&>() << val<T>(), void())> {
+ static constexpr bool value = true;
+ };
+}
+
+static_assert(!C::has_insertion_operator<B::bar>::value, "");
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-08 14:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-08 14:49 [gcc r12-7109] c++: Add testcase for already fixed PR [PR104425] Patrick Palka
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).