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] Import directive is deleted at the end of translation phase 4 #3201

Closed
RazvanAM opened this issue Aug 25, 2019 · 3 comments
Closed

Comments

@RazvanAM
Copy link

P1703 states that a line starting with the import preprocessing token is a preprocessing directive.

Such a line is processed first by the preprocessor (in translation phase 4, in order to import macro definitions) and it should also be processed in translation phase 7 (in order to import declarations). However, because such a line is a preprocessing directive, it is removed at the end of translation phase 4.

Is there something that I am overlooking?

Thank you.

@RazvanAM
Copy link
Author

RazvanAM commented Aug 25, 2019

I think one of the purposes of [cpp.import] p.2 is to say that the import directive is entirely replaced by the same tokens, except for the mentioned changes (e.g. import token replaced by the import-keyword token). Is this the intention?

Or is it that because the import token is replaced by the import-keyword token, the line is not considered a preprocessing directive anymore, therefore it does not get removed?

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Aug 30, 2019
@jensmaurer jensmaurer added cwg Issue must be reviewed by CWG. and removed decision-required A decision of the editorial group (or the Project Editor) is required. labels Sep 9, 2019
@jensmaurer
Copy link
Member

Editorial teleconference: This area is in flux and likely to change next time.

@jensmaurer jensmaurer changed the title Import directive is deleted at the end of translation phase 4 [cpp.import] Import directive is deleted at the end of translation phase 4 Sep 24, 2019
@jensmaurer jensmaurer removed the cwg Issue must be reviewed by CWG. label Nov 6, 2020
@jensmaurer
Copy link
Member

There are now clarifying notes in cpp.module:

The module and export (if it exists) preprocessing tokens are replaced by the module-keyword and export-
keyword preprocessing tokens respectively.
[Note 2 : This makes the line no longer a directive so it is not removed at the end of phase 4. — end note]

and in cpp.import:

In all three forms of pp-import, the import and export (if it exists) preprocessing tokens are replaced by the
import-keyword and export-keyword preprocessing tokens respectively.
[Note 1 : This makes the line no longer a directive so it is not removed at the end of phase 4. — end note]

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