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

[basic.def.odr] Add serial comma #6368

Closed
wants to merge 1 commit into from
Closed

Conversation

Eisenwave
Copy link
Contributor

It would be more appropriate in American English to use a comma in this place.

Without the comma, the sentence reads as:

[...] is attached to a named module and [to something else]

With the comma, the sentence reads as:

[...] is attached to a named module, and [there is another requirement]

The second reading is correct here, given the rest of the sentence.

@jwakely
Copy link
Member

jwakely commented Jul 6, 2023

This isn't strictly needed because "atttached to a named module and attached to a prior definition is reachable at the point where a later definition occurs" is meaningless, so only the second reading is possible.

@jwakely
Copy link
Member

jwakely commented Jul 6, 2023

That is, I think without the comma the sentence could potentially be read in two ways (not only in the first way as you imply). But since the first reading is meaningless, it has to be read the second way.

The comma avoids requiring lookahead and tentative parsing to decide which meaning is valid.

@Eisenwave
Copy link
Contributor Author

The comma avoids requiring lookahead and tentative parsing to decide which meaning is valid.

Yes, I agree; once the sentence is read in full, only one interpretation is meaningful. I've added the comma not to remove ambiguity; it's just a minor stylistic improvement which eliminates that look-ahead.

@tkoeppe tkoeppe closed this Nov 10, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants