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

[stmt.return] Change 'void' to 'cv void' #927

Closed
wants to merge 1 commit into from

Conversation

jlaire
Copy link

@jlaire jlaire commented Sep 20, 2016

Using "cv void" here is consistent with 3.9.1p9.

It's not clear to me whether the cv of the expression and the cv of the function are independent meta variables or whether they should match, both in 3.9.1p9 and 6.6.3p2. Can a function with any cv-qualified void return type return a void with a different cv-qualifier?

const volatile void fcv() {}
void f() { return fcv(); }

A note about formatting: basic.tex uses \term{cv} but statements.tex uses \cv. There are also instances of \cvqual{cv} in other files.

@zygoloid
Copy link
Member

An expression cannot have type cv void. All void-typed expressions are prvalues, and prvalues of non-class, non-array type are never cv-qualified; the type of fcv() in your example is just void.

@jlaire
Copy link
Author

jlaire commented Sep 22, 2016

So should 3.9.1p9 be changed to remove the cv? "An expression of type cv void shall be used only ..."

@jensmaurer
Copy link
Member

"So should 3.9.1p9 be changed to remove the cv?"

We agree this is technically redundant, but given the context in which it appears (see prior sentence), we decided not to make any change.

@jensmaurer jensmaurer closed this Nov 12, 2016
@jlaire jlaire deleted the return-cv-void branch November 12, 2016 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants