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
[module.private.frag] A confused example #4890
Comments
In your example, there are two definition domains: One is the private-module-fragment; the other one is the rest of the translation unit. My guess is that at |
This example is a formal case located in [module.private.frag], I just think the comments are confusing here. We agree on
The definition is defined in private-module-fragment but not in the rest. |
P1815R2 probably outdated the example; it certainly outdated the one in [module.interface]/7 that says namespace {
struct S { };
}
export void f(S); // OK |
Agree! it should be ill-formed since it violates [basic.link] p17. |
In this example,
#1
and#2
both attach to moduleA
, they have external or module linkage, respectively. In terms of this case, [basic.def.odr] p11, [dcl.inline] p5 and p7 should apply to both#1
and#2
. The definition of definition domain is defined as thatI'm not sure whether the intent of this rule is that a
private-module-fragment
can divide out another definition domain in a translation unit. If it is,#2
should be ill-formed since it is odr-used in the first definition domain but its definition appears in another domain, as per [basic.def.odr] p11Except that, I'm not seeing any difference between
#1
and#2
in terms of this example, that is, they should have the same treatment unless there are some normative rules that differentiate them in this case.The text was updated successfully, but these errors were encountered: