From: Patrick Palka Date: Tue, 8 Feb 2022 14:47:34 +0000 (-0500) Subject: c++: Add testcase for already fixed PR [PR104425] X-Git-Tag: basepoints/gcc-13~1204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be862bf1f612c884597ace4cbfdec972a0bf0eef;p=thirdparty%2Fgcc.git 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 --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, "");