diff options
author | Marek Polacek <polacek@redhat.com> | 2020-04-21 18:11:33 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-04-22 15:53:34 -0400 |
commit | edfa7c684d329708dcee733fcb552bed9d931621 (patch) | |
tree | 2854d060d6d0256b9538a72749ab7cd2c9789b24 /gcc/cp/constraint.cc | |
parent | 1868599f8daf7798018ce8a8f314015f5a2ac520 (diff) | |
download | gcc-edfa7c684d329708dcee733fcb552bed9d931621.zip gcc-edfa7c684d329708dcee733fcb552bed9d931621.tar.gz gcc-edfa7c684d329708dcee733fcb552bed9d931621.tar.bz2 |
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.
Diffstat (limited to 'gcc/cp/constraint.cc')
0 files changed, 0 insertions, 0 deletions