C++ Logo


Advanced search

Re: Ambiguities of the C++ Standard definitions.

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Wed, 7 Dec 2022 12:07:55 -0500
On Wed, Dec 7, 2022 at 12:00 PM Vladimir Grigoriev via Std-Discussion
<std-discussion_at_[hidden]> wrote:
> Well, consider another phrase from the C++ Standard
> «2 In a function-definition, either void declarator ; or declarator ; shall be a well-formed function declaration ...»
> What is the «void declarator»? I have not found the definition of this term. It seems these word combination is encountered only once in the C++ Standard.

You're misreading the standard. It's not "void declarator"; it's "void
declarator;" . That is, it is talking about a specific sequence of
tokens and grammatical constructs. "void" is the keyword token `void`
(that's why it is in fixed-width text). "declarator" is the
grammatical construct declarator (that's why it is in italic text).
And ";" is the semicolon token (also in fixed-width text).

Now, you might say that the entire text "void declarator;" should
probably better distinguish itself from literal wording. But by the
rules of the C++ standard, this is not ambiguous.

Received on 2022-12-07 17:09:50