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

Resolution of CWG 2017 "Flowing off end is not equivalent to no-expression return" #561

Closed
petrochenkov opened this issue Nov 18, 2015 · 4 comments

Comments

@petrochenkov
Copy link

The text in http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0167r0.html#2017 says:

Change 6.6.3 [stmt.return] paragraph 2 as follows:

...Flowing off the end of a function with a void return type is equivalent to a return with no value; this results in undefined behavior in a value-returning function operand. Otherwise, flowing off the end of a function other than main (3.6.1 [basic.start.main] results in undefined behavior.

Should it be ... a function with a *cv* void return type is equivalent to ...?

@Arcoth
Copy link
Contributor

Arcoth commented Nov 18, 2015

It appears that if the indefinite article or plural form is used, the set of types {void, volatile void, const void, const volatile void} is being referred to. This is consistent with the formatting - fixed width is only employed when talking of void, not "the void types" or "a void type". E.g. [basic.types]/5:

Incompletely-defined object types and the void types are incomplete types (3.9.1).

@timsong-cpp
Copy link
Contributor

That particular phrasing from [basic.types]/5 has just been cleaned up by CWG 2006.

@petrochenkov
Copy link
Author

Oh, and I think constructors are not covered by this resolution, since they have no return types?

@petrochenkov
Copy link
Author

Fixed in N4582

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

No branches or pull requests

3 participants