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] p12 Is the definition domain isolated or union #5561
Comments
The definition domain is obviously defined per translation unit ("portion of a translation unit"); claiming that definition domains of different translation units are somehow merged is an adverse reading not support by the current wording. |
Consider the first wording in [basic.def.odr] p12
This just sounds like every
So, whose member? what group? It is vague here. what I'm claiming here is to give the definition domain an extent constraint. At least, we should say
which means that each time we talk about the definition domain, we actually talk about the definition domain of a particular translation unit. |
private-module-fragment is a grammar non-terminal. There's no way how those could be merged (lexically?) across translation units, given [lex.phases]. |
I think it may at least be an improvement to emphasize this point. This means regardless of private-module-fragment or the other portion, they are all part of the current translation unit we are talking about. |
[basic.def.odr] p12 says
Are all definition domains that are the same kind in different translation units considered as if they were a single definition domain? which is similar to namespaces that are defined in different translation units:
Namespace
C
and functionfun
in translation unitA
and the corresponding namespace and function in translation unitB
both respectively refer to the same entity even though they are (lexically)declared in different translation units. Is the definition domain similar to it? In other words, a definition domain is a union of the same kind of definition domain of every translation unit.It seems the intent should be that the definition domain is isolated by the translation unit. Specifically, the domain associated with private-module-fragment in TU
A
is a different definition domain from that associated with private-module-fragment in TUB
. The same is true for the definition domain that is associated with the rest portion of a translation unit.So, when we use the "definition domain" to phrase a rule, is it better if we give an extent to the definition domain in order to avoid over-reading? For example:
[dcl.inline] p7 says
Limit the definition domain we talk about to a single translation unit.
The text was updated successfully, but these errors were encountered: