Created on 2023-08-08.00:00:00 last changed 8 months ago
Proposed resolution (approved by CWG 2023-11-07):
Change in 12.2.4.1 [over.match.best.general] bullet 2.6 as follows:
- ...
- F1 and F2 are non-template functions
withandor if not that,
- they have the same
parameter-type-listsnon-object-parameter-type-lists (9.3.4.6 [dcl.fct]), and- if they are member functions, both are direct members of the same class, and
- if both are non-static member functions, they have the same types for their object parameters, and
- F1 is more constrained than F2 according to the partial ordering of constraints described in 13.5.5 [temp.constr.order],
[ Example:
template <typename T = int> struct S { constexpr void f(); // #1 constexpr void f(this S&) requires true; // #2 }; void test() { S<> s; s.f(); // calls #2 }-- end example ]
- ...
[Accepted as a DR at the November, 2023 meeting.]
Consider:
template <typename T = int> struct S { constexpr void f(); // #1 constexpr void f(this S&) requires true; // #2 }; void test() { S<> s; s.f(); // #3 }
With the current rules, the call at #3 is ambiguous, even though #2 is more constrainted.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-04-05 21:43:46 | admin | set | status: dr -> drwp |
2023-12-19 10:15:28 | admin | set | status: ready -> dr |
2023-11-08 05:03:56 | admin | set | status: review -> ready |
2023-09-16 05:22:26 | admin | set | messages: + msg7434 |
2023-09-16 05:22:26 | admin | set | status: open -> review |
2023-08-08 00:00:00 | admin | create |