-
Notifications
You must be signed in to change notification settings - Fork 789
[lex.separate][module.unit] move definitions of program and translation unit #7180
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
base: main
Are you sure you want to change the base?
Conversation
Just to confirm that I looked at every reference for program and translation unit to see if they had a cross reference that should be updated. These terms occur quite frequently, but rarely have a cross-reference, and in those places that do have a cross reference, they are frequently cross referencing a concept in the whole sentence rather than a definition of either term. |
86d979a
to
413da6a
Compare
Note to CWG chair: this PR, if accepted, would seem to be making progress towards resolving http://wg21.link/cwg2670. |
413da6a
to
be3e611
Compare
ed14973
to
6b5b3b1
Compare
source/modules.tex
Outdated
\nontermdef{translation-unit}\br | ||
\opt{declaration-seq}\br | ||
\opt{global-module-fragment} module-declaration \opt{declaration-seq} \opt{private-module-fragment} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A translation-unit is not necessarily a module unit, so I find this new place not good. I agree having this production in [lex] is not good, either, because this is a phase 7 grammar production. I agree that [basic.link] isn't a great place, so it's either [basic.pre] or a new subclause [basic.program].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking again, I think the best location is to introduce [basic.def]. What you you think?
…on unit The definition of program at the top of [basic.link] should move to the front of [lex.separate] so that it is defined before its first usage, and also clarifies that is what the phases of translation produce. Similarly, move the definition of the grammar production translation-unit to the top of the only clause whose grammar actually uses it, [module.unit]. Finally, retitle [basic.link] as just Linkage, rather than Programs and linkage.
6b5b3b1
to
3f83595
Compare
The definition of program at the top of [basic.link] should move to the front of [lex.separate] so that it is defined before its first usage, and also clarifies what the phases of translation produce.
The description of translation unit in [basic.link] is provided only to support the definition of program. However, that description is no longer useful now that the term has a definition in [lex.phases]. The description is also never referenced In the rest of [basic.link]. If we remove that description, then there is nothing tying the definition of the grammar term translation-unit to [basic.link] either, so move it to the place where that definition is most useful, at the top of [module.unit]. It is tempting to move the grammar definitions of global-module-framgment and private-module-framgment to the collected grammar at the top of this clause two, but leaving them in their current subclauses for now, pending further feedack.
Finally, retitle [basic.link] as just Linkage, rather than Programs and linkage, as the subclause was never about the terms described in the opening paragraph and never mention again (within this clause).