Created on 2022-04-11.00:00:00 last changed 18 months ago
Subclause 12.2.2.2.3 [over.call.object] paragraph 2 considers only
those conversion functions matching a particular grammar pattern. This
unintendedly excludes conversion functions with an explicit object
parameter (and, as a pre-existing defect, noexcept
conversion functions):
In addition, for each non-explicit conversion function declared in T of the formoperator conversion-type-id ( ) cv-qualifier-seqopt ref-qualifieropt noexcept-specifieropt attribute-specifier-seqopt ;where the optional cv-qualifier-seq is the same cv-qualification as, or a greater cv-qualification than, cv, and where conversion-type-id denotes the type “pointer to function of (P1 , . . . , Pn ) returning R”, or the type “reference to pointer to function of (P1 , . . . , Pn ) returning R”, or the type “reference to function of (P1 , . . . , Pn ) returning R”, a surrogate call function with the unique name call-function and having the formR call-function ( conversion-type-id F, P1 a1 , ... , Pn an ) { return F (a1 , . . . , an ); }is also considered as a candidate function. Similarly, surrogate call functions are added to the set of candidate functions for each non-explicit conversion function declared in a base class of T provided the function is not hidden within T by another intervening declaration. [ Footnote: ...]
For example, there is implementation divergence in handling this example:
using fn_t = void(); struct C { operator fn_t * (this C const &); }; void foo(C c) { c(); }
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-06-20 19:34:52 | admin | set | status: open -> drafting |
2022-04-11 00:00:00 | admin | create |