You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As char is not considered as an unsigned integer type even if std::is_unsigned_v<char> is true, can we replace all uses of "unsigned ordinary character" with unsigned char?
I think we mean unsigned char plus "char if it is unsigned" with this phrase, but we should add a definition in [basic.fundamental] p7. @zygoloid , can you confirm that "unsigned ordinary character type" includes char when it is unsigned?
I think this point is probably right, but it seems never explicitly stated.
Before P1236R1, [basic.fundamental] used the item "unsigned narrow character types" (used to be ambiguous "unsigned character types" before CWG 1539), which implied there may be more than one such types (in which case they are unsigned char and char), and the "unsigned" was unrelated to "unsigned integer type".
However, the phrase "unsigned narrow character types" was changed to "narrow character types" by P1236R1, then such implication disappeared. And the usage of "unsigned narrow character" (used to be in [dcl.init], changed to "unsigned ordinary character" by P0482R6) became ambiguous (if it was not ambiguous at first).
The change from "narrow" to "ordinary" became necessary when char8_t was introduced, because this type does not participate in aliasing and other special rules of the abstract machine.
@Eisenwave I think that email is just a restatement of the problem, presumably with the intention of creating a CWG issue (@jensmaurer?). So let's close this.
Activity
jensmaurer commentedon Oct 26, 2021
I think we mean
unsigned char
plus "char if it is unsigned" with this phrase, but we should add a definition in [basic.fundamental] p7. @zygoloid , can you confirm that "unsigned ordinary character type" includeschar
when it is unsigned?The notion of unsigned integer type is unrelated.
frederick-vs-ja commentedon Oct 27, 2021
I think this point is probably right, but it seems never explicitly stated.
Before P1236R1, [basic.fundamental] used the item "unsigned narrow character types" (used to be ambiguous "unsigned character types" before CWG 1539), which implied there may be more than one such types (in which case they are
unsigned char
andchar
), and the "unsigned" was unrelated to "unsigned integer type".However, the phrase "unsigned narrow character types" was changed to "narrow character types" by P1236R1, then such implication disappeared. And the usage of "unsigned narrow character" (used to be in [dcl.init], changed to "unsigned ordinary character" by P0482R6) became ambiguous (if it was not ambiguous at first).
jensmaurer commentedon Oct 27, 2021
The change from "narrow" to "ordinary" became necessary when
char8_t
was introduced, because this type does not participate in aliasing and other special rules of the abstract machine.jensmaurer commentedon Nov 4, 2021
http://lists.isocpp.org/core/2021/11/11656.php
unsigned char
#6463Eisenwave commentedon Aug 19, 2023
@jensmaurer is there a publicly accessible link to that issue?
Eisenwave commentedon Aug 19, 2023
Related: cplusplus/CWG#403
tkoeppe commentedon Nov 10, 2023
@Eisenwave I think that email is just a restatement of the problem, presumably with the intention of creating a CWG issue (@jensmaurer?). So let's close this.