Files
cppdraft_translate/cppdraft/cpp/module.md
2025-10-25 03:02:53 +03:00

3.5 KiB

[cpp.module]

15 Preprocessing directives [cpp]

15.5 Module directive [cpp.module]

pp-module:
exportopt module pp-tokensopt ; new-line

1

#

A pp-module shall not appear in a context where module or (if it is the first preprocessing token of the pp-module) export is an identifier defined as an object-like macro.

2

#

The pp-tokens, if any, of a pp-module shall be of the form:

pp-module-name pp-module-partitionopt pp-tokensopt

where the pp-tokens (if any) shall not begin with a ( preprocessing token and the grammar non-terminals are defined as:

pp-module-name:
pp-module-name-qualifieropt identifier

pp-module-partition:
pp-module-name-qualifieropt identifier

pp-module-name-qualifier:
identifier .
pp-module-name-qualifier identifier .

No identifier in the pp-module-name or pp-module-partition shall currently be defined as an object-like macro.

3

#

Any preprocessing tokens after the module preprocessing token in the module directive are processed just as in normal text.

[Note 1:

Each identifier currently defined as a macro name is replaced by its replacement list of preprocessing tokens.

— end note]

4

#

The module and export (if it exists) preprocessing tokens are replaced by the module-keyword andexport-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]