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

[cpp.import]/3 What if pp-import is produce by #include within private module fragment? #4618

Closed
onihusube opened this issue May 31, 2021 · 2 comments

Comments

@onihusube
Copy link
Contributor

In module-file it is forbidden.

However, it is unclear whether private module fragment is included in that (module-file), and if it is, then global module fragment is included as well.

Looking at P1857R3, which introduced this clause, it says:

  1. Change Log
  • R2
    • Add wording that rejects #includes from turning into imports in the purview of a module.

Since it says "purview of a module", there seems to be no intention to include global module fragment. On the other hand, private module fragment seems to be included.

The current clause [cpp.import]/3 seems to either include both fragments or none of them.

At least I think private module fragment is included, but what about?

If a pp-import is produced by source file inclusion (including by the rewrite produced when a #include directive names an importable header) while processing the group of a module-file or pp-private-module-fragment
, the program is ill-formed.

@jensmaurer
Copy link
Member

We usually use the phrase "named module" if we wish to exclude the global module. I haven't looked in detail whether that would address the concern here.

@onihusube
Copy link
Contributor Author

onihusube commented Jun 1, 2021

Is it correct that the group in this clause recursively includes the group in the two fragments?

It seems to make sense when you consider the purpose of P1857R3.

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

No branches or pull requests

2 participants