c++: Add test for c++/93807
This PR was initially accepts-invalid, but I think it's actually valid C++20 code. My reasoning is that in C++20 we no longer require the declaration of operator== (#if-defed in the test), because C++20's [temp.names]/2 says "A name is also considered to refer to a template if it is an unqualified-id followed by a < and name lookup either finds one or more functions or finds nothing." so when we're parsing constexpr friend bool operator==<T>(T lhs, const Foo& rhs); we treat "operator==" as a template name, because name lookup of "operator==" found nothing and we have an operator-function-id, which is an unqualified-id, and it's followed by a <. So the declaration isn't needed to treat "operator==<T>" as a template-id. PR c++/93807 * g++.dg/cpp2a/fn-template20.C: New test.
Showing
gcc/testsuite/g++.dg/cpp2a/fn-template20.C
0 → 100644
Please
register
or
sign in
to comment