cplusplus / cplusplus/draft

[dcl.constinit] p1 "Declaration of a variable" is broken wording

Open
#6,523 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The constinit specifier shall be applied only to a declaration of a variable with static or thread storage duration.

- [dcl.constinit] p1

This is broken wording because [basic.pre] says:

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.

What the former paragraph says is thus:

The constinit specifier shall be applied only to a declaration of a declaration of an object or reference other than a non-static data member or of an object, with static or thread storage duration.

Inlining the definition gives us "declaration of a declaration" which is either meaningless or recursive.

Suggested Fix

Extend [basic.pre] p6 as follows:

 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.
+Such a declaration is called *variable declaration*.

Then, in the entire document:

-declaration of a variable
+variable declaration

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

Start with [basic.pre] p6 and [dcl.constinit] p1, then search the document for every occurrence of “declaration of a variable.” Apply the proposed terminology change and confirm that the revised wording is grammatically correct and consistent throughout the draft.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.