Rejects-valid for overloaded hidden non-template friend functions with mutually exclusive requires-clauses #48216
Labels
bugzilla
Issues migrated from bugzilla
c++20
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
concepts
C++20 concepts
Extended Description
As per [defns.signature.friend] in N4861, the signature of a non-template friend function includes a trailing requires-clause, if it is present. Moreover, [over.dcl]/1 states that two function declarations declare different functions if they have different trailing requires-clauses.
The following example fails to compile for Clang (-std=c++2b, 12.0.0 trunk):
which is arguably incorrect, as the two, separate (by separate requires-clauses) friend declarations (that are also definitions) should not generate the same mangled name.
(Constrained hidden non-template friends was added as per NS US115 of P2103R0; http://open-std.org/JTC1/SC22/WG21/docs/papers/2020/p2103r0.html)
The text was updated successfully, but these errors were encountered: