Skip to content

Non-defining object declarations can have type cv void CWG2475 #3953

Description

@sdkrystian

Nothing prohibits an object declaration from having type cv void. While there is wording that prevents an object definition from having such a type in [basic.def], so such wording exists to cover the following:

extern void var; // not a definition, so incomplete type is permitted

Activity

  1. jensmaurer commented on Oct 30, 2020

    @jensmaurer
    Member

    While pretty obvious, this does not feel editorial to me.

    [dcl.pre] p10 introduces "object declaration" (which, curiously enough, might also declare a reference). This would be a suitable place to prohibit "cv void".

  2. jensmaurer commented on Dec 7, 2020

    @jensmaurer
    Member

    CWG 2020-12-07:
    C allows extern void var;
    A new core issue will be created, and deferred to the WG14/WG21 liaison group.

  3. jensmaurer commented on Dec 7, 2020

    @jensmaurer
    Member

    [basic.pre] p6

    A variable is introduced by the declaration of a reference other than a non-static data member or of an object. The variable’s name, if any, denotes the reference or object.

    Presumably, an "object" must have object type.

  4. added
    not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.
    on Dec 7, 2020
  5. changed the title [-]Non-defining object declarations can have type cv void[/-] [+]Non-defining object declarations can have type cv void CWG2475[/+] on Feb 26, 2022
  6. jensmaurer commented on Feb 26, 2022

    @jensmaurer
    Member
  7. frederick-vs-ja commented on Aug 1, 2023

    @frederick-vs-ja
    Contributor

    Should have been resolved by #6118 (4682d95).

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.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions