Hello W21,
The following example shows a static_cast as per [expr.static.cast#7]:
```CPP
int v = 10;
auto lambda = [v](int)
{
return v + 32;
};
void * ptr = λ
auto * reverse = static_cast<decltype(lambda) *>(ptr);
```In a constant expression, this is invalid because of [expr.const-5.14].
However, in this case it is an inverse of a conversion sequence. Since this causes issues when implementing a constexpr `std::function_ref` and similar usages I believe the clause should be modified to the following:
> (5.14) a conversion from type cv void* to a pointer-to-object type<ins>, other than when this conversion is the inverse of any standard conversion sequence</ins>;
--Or if it is to be more consistant with static_cast's ```[expr.static.cast#7]:
> (5.14) a conversion from type cv void* to a pointer-to-object type<ins>, other than when this conversion is the inverse of any standard conversion sequence ([conv]) not containing an lvalue-to-rvalue ([conv.lval]), array-to-pointer ([conv.array]), function-to-pointer ([conv.func]), null pointer ([conv.ptr]), null member pointer ([conv.mem]), boolean ([conv.bool]), or function pointer ([conv.fctptr]) conversion</ins>;
PS. I acciddently sent this to the wrong contact. I believe it was previously sent to wg21bot@gmx.net. Which could be an issue, apologies.
Regards,
David Ledger
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals