Fix inappropriate font choices for "declaration"
- Document number:
- P3924R0
- Date:
2025-12-13 - Audience:
- CWG
- Project:
- ISO/IEC 14882 Programming Languages — C++, ISO/IEC JTC1/SC22/WG21
- Reply-to:
- Jan Schultke <janschultke@gmail.com>
- GitHub Issue:
- wg21.link/P3924/github
- Source:
- github.com/eisenwave/cpp-proposals/blob/master/src/fix-declaration-font.cow
Contents
Introduction
Wording
[basic]
[stmt]
[dcl]
[class.dtor]
[over.literal]
References
1. Introduction
The C++ standard has two similar terms:
- the regular-font "declaration" defined in [basic.pre]
- the grammatical
declaration defined in [dcl]
.
There are instances where these have been used incorrectly. NB comment US 11-400 requests:
Perform a thorough review of each usage of the term "declaration" to confirm that it is rendered in the correct style.
Such a review has been performed.
The vast majority of occurrences are "declaration", not
In some cases, the surrounding wording is adjusted
to fit the existing use of
2. Wording
[basic]
Change [basic.def] paragraph 2 as follows:
Each entity declared by a declaration is also defined by that declaration unless:
- […]
-
it is an
explicit specializationexplicit-specialization ([temp.expl.spec]) whosedeclaration is not a definition.
Change [basic.scope.scope] note 1 as follows:
[Note: Special cases include that:
- […]
-
The
declaration indeclaration of atemplate-declaration inhabits the same scope as thetemplate-declaration . - […]
— end note]
Do not change [basic.link] paragraph 1:
A program consists of one or more translation units ([lex.separate]) linked together. A translation unit consists of a sequence of declarations.
translation-unit :- […]
[stmt]
Do not change [stmt.pre] paragraph 7:
If a
condition can be syntactically resolved as either an expression or a declaration, it is interpreted as the latter.
Change [stmt.block] paragraph 2 as follows:
[Note:
A compound statement defines a block scope ([block.scope]).
A declaration
is a
— end note]
Change [stmt.expand] paragraph 5, bullet 3 as follows:
Otherwise, is a destructuring expansion statement and is equivalent to:
where is the structured binding size
of the type of the
The keyword is present in the
declaration is one of the
[dcl]
Change [dcl.stc] paragraph 1 as follows:
[…]
If a specifier in the same declaration
Change [dcl.type.cv] paragraph 1 as follows:
[…]
If a declaration
Do not change [dcl.type.elab] paragraph 2 as follows:
If an
elaborated-type-specifier is the sole constituent of a declaration, the declaration is ill-formed unless it is an explicit specialization ([temp.expl.spec]), a partial specialization ([temp.spec.partial]), an explicit instantiation ([temp.explicit]), or it has one of the following forms:[…]
Change [dcl.decl.general] paragraph 3 as follows:
Each in a declaration
is analyzed separately
as if it were in a declaration
Do not change [dcl.ambig.res] paragraph 1:
[…] However, a construct that can syntactically be a
declaration whose outermostdeclarator would match the grammar of adeclarator with atrailing-return-type is a declaration only if it starts with.auto
Change [dcl.meaning.general] paragraph 4 as follows:
A , , , , ,
, , , , ,
or specifier or an declaration
[class.dtor]
Do not change [class.dtor] paragraph 1:
A declaration whose
declarator-id has anunqualified-id that begins with adeclares a prospective destructor; its~ declarator shall be a function declarator ([dcl.fct]) of the form […]
Do not change [class.conv.fct] paragraph 1:
A declaration whose
declarator-id has anunqualified-id that is aconversion-function-id declares a conversion function; itsdeclarator shall be a function declarator ([dcl.fct]) of the form […]
[over.literal]
Do not change [over.literal] paragraph 2:
A declaration whose
declarator-id is aliteral-operator-id shall declare a function or function template […]