From be862bf1f612c884597ace4cbfdec972a0bf0eef Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Tue, 8 Feb 2022 09:47:34 -0500 Subject: [PATCH] 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. --- .../template/partial-specialization10.C | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/partial-specialization10.C 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 000000000000..d03f313745b5 --- /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 T val(); + + A::foo& operator<<(A::foo& f, int in); + + template + struct has_insertion_operator { + static constexpr bool value = false; + }; + + template + struct has_insertion_operator() << val(), void())> { + static constexpr bool value = true; + }; +} + +static_assert(!C::has_insertion_operator::value, ""); -- 2.47.2