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

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

Open
sdkrystian opened this issue Apr 22, 2020 · 5 comments
Open

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

sdkrystian opened this issue Apr 22, 2020 · 5 comments
Labels
cwg Issue must be reviewed by CWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.

Comments

@sdkrystian
Copy link
Contributor

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

jensmaurer commented Oct 30, 2020

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

@jensmaurer jensmaurer added the cwg Issue must be reviewed by CWG. label Oct 30, 2020
@jensmaurer
Copy link
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.

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

@jensmaurer jensmaurer added the not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. label Dec 7, 2020
@jensmaurer jensmaurer changed the title Non-defining object declarations can have type cv void Non-defining object declarations can have type cv void CWG2475 Feb 26, 2022
@jensmaurer
Copy link
Member

See CWG2475

@frederick-vs-ja
Copy link
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
Labels
cwg Issue must be reviewed by CWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
Development

No branches or pull requests

3 participants