cplusplus / cplusplus/draft

[basic.fundamental] Turn normative wording for `void` return types into a note

Open
#6,466 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

P3-Other
Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

After submitting https://github.com/cplusplus/draft/pull/6465, I feel like the wording for saying what a return type of void means is out-of-place. [basic.fundamental] p15 says:

It is used as the return type for functions that do not return a value.

This wording is redundant, as the meaning of return type void and calls to functions with return type void emerges from other parts of the standard. It even emerges from the paragraph itself because if "such a type has an empty set of values", it is obvious that a function with return type void cannot return a value.

Furthermore, this is too specific for [basic.fundamental]. If we're already explaining what a return type of void does here, why not also explain what a parameter-list containing just void means?

Suggested Change
 A type cv void is an incomplete type that cannot be completed; such a type has an empty set of values.
-It is used as the return type for functions that do not return a value.
 [...]
+[ Note: A function with a cv void return type does not return a value. -- end note ]

Alternatively, remove this sentence completely and leave no note.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read [basic.fundamental] paragraph 15 and the surrounding wording, using pull request 6465 as context. Apply the proposed note or remove the sentence, then verify that the draft no longer presents the redundant normative wording.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.