Let's look at the usages of _object-declaration_:
(numbers are taken from C++14 IS, but no additional occurrences in
recent drafts)
7p8 An object declaration, however, is also a definition unless it
contains the extern specifier and has no initializer
Also applies to references.
7.1.5p9 A constexpr specifier used in an object declaration declares the
object as const. Such an object [...]
Only applies to objects.
8.2p1 The ambiguity arising from the similarity between a function-style
cast and a declaration mentioned in 6.8 can also occur in the context of
a declaration. In that context, the choice is between a function
declaration with a redundant set of parentheses around a parameter name
and an object declaration with a function-style cast as the initializer.
Applies to both, but to me seems to be more informative than normative.
C.1.6 For ease of use, C ++ doesn’t require that a type name be prefixed
with the keywords class, struct or union when used in object
declarations or type casts.
Irrelevant / applies to both. Informative IMHO
Can't find any relevant issues on the CWG lists.
I remember having wondered about that definition myself some time ago,
but I just suspected this to be another lax usage of words
(differentiate function declarations from object+reference
declarations). 7.1.5p9 however doesn't seem to be correct wrt object
declarations of references.
Kind regards,
dyp
On 19.06.2015 10:35, 'Johannes Schaub' via ISO C++ Standard - Discussion
wrote: