Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[basic.indet][bit.cast] Why "unsigned ordinary character"? #5070

Closed
frederick-vs-ja opened this issue Oct 25, 2021 · 7 comments
Closed

[basic.indet][bit.cast] Why "unsigned ordinary character"? #5070

frederick-vs-ja opened this issue Oct 25, 2021 · 7 comments
Labels
cwg Issue must be reviewed by CWG.

Comments

@frederick-vs-ja
Copy link
Contributor

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?

@jensmaurer
Copy link
Member

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?

The notion of unsigned integer type is unrelated.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Oct 26, 2021
@frederick-vs-ja
Copy link
Contributor Author

The notion of unsigned integer type is unrelated.

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).

@jensmaurer
Copy link
Member

jensmaurer commented 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
Copy link
Member

@Eisenwave
Copy link
Contributor

http://lists.isocpp.org/core/2021/11/11656.php

@jensmaurer is there a publicly accessible link to that issue?

@Eisenwave
Copy link
Contributor

Related: cplusplus/CWG#403

@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 7, 2023
@tkoeppe
Copy link
Contributor

tkoeppe commented 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.

@tkoeppe tkoeppe closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG.
Projects
None yet
Development

No branches or pull requests

4 participants