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

US086 10.03 Treatment of non-exported imports #85

Closed
wg21bot opened this issue Oct 23, 2019 · 3 comments · Fixed by cplusplus/draft#3442
Closed

US086 10.03 Treatment of non-exported imports #85

wg21bot opened this issue Oct 23, 2019 · 3 comments · Fixed by cplusplus/draft#3442
Labels
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Oct 23, 2019

When a translation unit U imports translation unit T, the wording in 10.3/6 treats non-exported imports in T differently depending on whether T and U are in the same module. If they are in the same module those imports are also imported by U. This inconsistency is presumably to allow U to implicitly import implementation partitions imported by T, which cannot be exported. However this also applies to unrelated imports in T, including those within the global module fragment caused by implicit translation of #includes. This has an effect on the reachability rules in 10.6/1

Proposed change:
A few options, some of which can be sensibly combined:
1. Apply this only to imports within the module purview of T
2. Apply this only for imports of partitions of the same module as T. Possibly only implementation partitions, because interface partitions could be directly exported
3. Eliminate this implicit import rule, and only implicitly import explicitly exported imports.
4. Eliminate the distinction between interface and implementation partitions. Allow any partition unit to be exported. Only require partition units containing export declarations to be exported by the primary interface unit.

@wg21bot wg21bot added CWG Core modules Modules labels Oct 23, 2019
@jensmaurer
Copy link
Member

CWG in Belfast: The wording is reflecting the design intent. For EWG to decide whether the design should change.

@jensmaurer jensmaurer added EWG Evolution and removed CWG Core labels Nov 5, 2019
@davidstone
Copy link
Collaborator

EWG voted to accept US086 for C++20 with modification by forwarding "option 1" to CWG to clarify the wording to match the intent.

@davidstone davidstone added CWG Core and removed EWG Evolution labels Nov 8, 2019
@jensmaurer
Copy link
Member

Accepted with modification. See paper P1979R0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants