Created on 2023-01-16.00:00:00 last changed 17 months ago
CWG 2023-01-27
Forward to EWG to determine whether such member declarations are considered sufficiently confusing to outweigh concerns of language orthogonality; see plusplus/papers#1455.
Suggested resolution:
Change in 6.4.1 [basic.scope.scope] paragraph 3, adding bullets, a follows:
Two function templates have corresponding signatures if
- their template-parameter-lists have the same length,
- their corresponding template-parameters are equivalent,
- they have equivalent
- parameter-type-lists or non-object-parameter-type-lists and
- return types (if any), and,
- if both are non-static members, they have corresponding object parameters.
Change in 6.4.1 [basic.scope.scope] bullet 4.3.1 as follows:
- both declare functions with the same parameter-type-list or non-object-parameter-type-list [Footnote: ...], equivalent (13.7.7.2 [temp.over.link]) trailing requires-clauses (if any, except as specified in 13.7.5 [temp.friend]), and, if both are non-static members, they have corresponding object parameters, or
[Accepted at the February, 2023 meeting as part of paper P2797R0.]
(Split off from issue 2687.)
Consider:
struct A { static void f(A); void f(this A); void g(); }; void A::g() { (&A::f)(A()); // #1 (&A::f)(); // #2 }
It is obvious that #2 is ill-formed, but what about #1? One possible answer is to make such declarations conflict.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-07-16 13:00:43 | admin | set | status: open -> c++23 |
2023-07-16 13:00:43 | admin | set | status: accepted -> open |
2023-02-18 18:43:04 | admin | set | status: open -> accepted |
2023-01-27 23:50:39 | admin | set | messages: + msg7155 |
2023-01-27 23:50:39 | admin | set | messages: + msg7154 |
2023-01-16 00:00:00 | admin | create |