This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++23 status.
convertible_to's description mishandles cv-qualified voidSection: 18.4.4 [concept.convertible] Status: C++23 Submitter: Tim Song Opened: 2020-07-03 Last modified: 2023-11-22
Priority: 0
View other active issues in [concept.convertible].
View all other issues in [concept.convertible].
View all issues with C++23 status.
Discussion:
There are no expressions of type cv-qualified void because any such
expression must be prvalues and 7.2.2 [expr.type]/2 states:
If a prvalue initially has the type "cv
T", whereTis a cv-unqualified non-class, non-array type, the type of the expression is adjusted toTprior to any further analysis.
However, 18.4.4 [concept.convertible] p1 states:
Given types
FromandToand an expressionEsuch thatdecltype((E))isadd_rvalue_reference_t<From>,convertible_to<From, To>requiresEto be both implicitly and explicitly convertible to typeTo.
When From is cv-qualified void, E does not exist, yet we do want
convertible_to<const void, void> to be modeled.
[2020-07-12; Reflector prioritization]
Set priority to 0 and status to Tentatively Ready after five votes in favour during reflector discussions.
[2020-11-09 Approved In November virtual meeting. Status changed: Tentatively Ready → WP.]
Proposed resolution:
This wording is relative to N4861.
Modify 18.4.4 [concept.convertible] as indicated:
-1- Given types
FromandToand an expressionEsuch thatwhose type and value category are the same as those ofdecltype((E))isadd_rvalue_reference_t<From>declval<From>(),convertible_to<From, To>requiresEto be both implicitly and explicitly convertible to typeTo. The implicit and explicit conversions are required to produce equal results.