Skip to content

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

Not planned
@frederick-vs-ja

Description

@frederick-vs-ja

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?

Activity

jensmaurer

jensmaurer commented on Oct 26, 2021

@jensmaurer
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.

added
decision-requiredA decision of the editorial group (or the Project Editor) is required.
on Oct 26, 2021
frederick-vs-ja

frederick-vs-ja commented on Oct 27, 2021

@frederick-vs-ja
ContributorAuthor

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

jensmaurer commented on Oct 27, 2021

@jensmaurer
Member

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.

added
cwgIssue must be reviewed by CWG.
on Nov 19, 2021
Eisenwave

Eisenwave commented on Aug 19, 2023

@Eisenwave
Member

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

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

Eisenwave

Eisenwave commented on Aug 19, 2023

@Eisenwave
Member
removed
decision-requiredA decision of the editorial group (or the Project Editor) is required.
on Nov 7, 2023
tkoeppe

tkoeppe commented on Nov 10, 2023

@tkoeppe
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cwgIssue must be reviewed by CWG.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tkoeppe@Eisenwave@frederick-vs-ja@jensmaurer

        Issue actions

          [basic.indet][bit.cast] Why "unsigned ordinary character"? · Issue #5070 · cplusplus/draft