Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dcl.init] should this 'declarator' be the 'initializer'8 #1615

Closed
Heuristack opened this issue Apr 18, 2017 · 4 comments
Closed

[dcl.init] should this 'declarator' be the 'initializer'8 #1615

Heuristack opened this issue Apr 18, 2017 · 4 comments
Assignees

Comments

@Heuristack
Copy link

Hi, I got confused when reading [dcl.init]

A declarator can specify an initial value for the identifier being declared.

Should it be like

An initializer can specify an initial value for the identifier being declared.

Noticed that the BNF reflecting the relationship between a declarator and an initializer,

\begin{bnf}
\nontermdef{init-declarator}\br
    declarator initializer\opt
\end{bnf}

FYI, @sdutoit, thanks!

@tkoeppe
Copy link
Contributor

tkoeppe commented Apr 18, 2017

I suppose a "declarator" (English) isn't the same as a "declarator" (grammar production). The former is more general. Although [dcl.dcl]p4 seems to use the term in the narrow sense.

@jensmaurer
Copy link
Member

@tkoeppe, I believe you're confused here.

@jensmaurer
Copy link
Member

[dcl.decl] p1 clearly distinguishes "declarator" and "initializer", and I fail to see a use of an English-level "declarator" anywhere. (Some of these words are not \grammarterm'ed, but probably should be.)

The note in [dcl.decl] p3 muddies the waters a bit, though.

Back to the original issue: I think this should be "An init-declarator can specify an initial value ..." In this context, an initializer always specifies an initial value, so it doesn't fit the "can" in the sentence.

@Heuristack
Copy link
Author

Heuristack commented Apr 19, 2017

I don't think #1616 is a proper fix for this issue and proposed #1617.

In this context, an initializer always specifies an initial value, so it doesn't fit the "can" in the sentence.

I think "can" here means an initializer is capable of specifying an initial value, and it "can" be used to do that or not, since it is optional (for a declarator).

jensmaurer added a commit to jensmaurer/draft that referenced this issue Apr 19, 2017
@jensmaurer jensmaurer changed the title [dcl.init] should this 'declarator' be the 'initializer'? [dcl.init] should this 'declarator' be the 'initializer'8 Apr 20, 2017
jensmaurer added a commit to jensmaurer/draft that referenced this issue Jul 21, 2017
jensmaurer added a commit to jensmaurer/draft that referenced this issue Aug 1, 2017
jensmaurer added a commit to jensmaurer/draft that referenced this issue Oct 18, 2017
zygoloid pushed a commit that referenced this issue Nov 12, 2017
AaronBallman pushed a commit to AaronBallman/draft that referenced this issue Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants