tmp/tmpwqw690xo/{from.md → to.md}
RENAMED
|
@@ -5,26 +5,26 @@ module-import-declaration:
|
|
| 5 |
import-keyword module-name attribute-specifier-seqₒₚₜ ';'
|
| 6 |
import-keyword module-partition attribute-specifier-seqₒₚₜ ';'
|
| 7 |
import-keyword header-name attribute-specifier-seqₒₚₜ ';'
|
| 8 |
```
|
| 9 |
|
| 10 |
-
A *module-import-declaration* shall
|
| 11 |
-
|
| 12 |
*export-declaration*s exporting *module-import-declaration*s shall
|
| 13 |
-
|
| 14 |
*translation-unit* and of the *private-module-fragment* (if any). The
|
| 15 |
optional *attribute-specifier-seq* appertains to the
|
| 16 |
*module-import-declaration*.
|
| 17 |
|
| 18 |
A *module-import-declaration* *imports* a set of translation units
|
| 19 |
determined as described below.
|
| 20 |
|
| 21 |
-
[*Note 1*: Namespace-scope
|
| 22 |
-
units
|
| 23 |
-
translation unit and declarations within the imported
|
| 24 |
-
become reachable [[module.reach]] in the importing
|
| 25 |
-
after the import declaration. — *end note*]
|
| 26 |
|
| 27 |
A *module-import-declaration* that specifies a *module-name* `M` imports
|
| 28 |
all module interface units of `M`.
|
| 29 |
|
| 30 |
A *module-import-declaration* that specifies a *module-partition* shall
|
|
@@ -57,11 +57,12 @@ headers that includes all importable C++ library headers [[headers]].
|
|
| 57 |
header. — *end note*]
|
| 58 |
|
| 59 |
[*Note 4*: A *module-import-declaration* nominating a *header-name* is
|
| 60 |
also recognized by the preprocessor, and results in macros defined at
|
| 61 |
the end of phase 4 of translation of the header unit being made visible
|
| 62 |
-
as described in [[cpp.import]].
|
|
|
|
| 63 |
|
| 64 |
A declaration of a name with internal linkage is permitted within a
|
| 65 |
header unit despite all declarations being implicitly exported
|
| 66 |
[[module.interface]].
|
| 67 |
|
|
@@ -75,12 +76,19 @@ When a *module-import-declaration* imports a translation unit T, it also
|
|
| 75 |
imports all translation units imported by exported
|
| 76 |
*module-import-declaration*s in T; such translation units are said to be
|
| 77 |
*exported* by T. Additionally, when a *module-import-declaration* in a
|
| 78 |
module unit of some module M imports another module unit U of M, it also
|
| 79 |
imports all translation units imported by non-exported
|
| 80 |
-
*module-import-declaration*s in the module unit purview of U.[^1]
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
A module implementation unit shall not be exported.
|
| 84 |
|
| 85 |
[*Example 1*:
|
| 86 |
|
|
|
|
| 5 |
import-keyword module-name attribute-specifier-seqₒₚₜ ';'
|
| 6 |
import-keyword module-partition attribute-specifier-seqₒₚₜ ';'
|
| 7 |
import-keyword header-name attribute-specifier-seqₒₚₜ ';'
|
| 8 |
```
|
| 9 |
|
| 10 |
+
A *module-import-declaration* shall inhabit the global namespace scope.
|
| 11 |
+
In a module unit, all *module-import-declaration*s and
|
| 12 |
*export-declaration*s exporting *module-import-declaration*s shall
|
| 13 |
+
appear before all other *declaration*s in the *declaration-seq* of the
|
| 14 |
*translation-unit* and of the *private-module-fragment* (if any). The
|
| 15 |
optional *attribute-specifier-seq* appertains to the
|
| 16 |
*module-import-declaration*.
|
| 17 |
|
| 18 |
A *module-import-declaration* *imports* a set of translation units
|
| 19 |
determined as described below.
|
| 20 |
|
| 21 |
+
[*Note 1*: Namespace-scope declarations exported by the imported
|
| 22 |
+
translation units can be found by name lookup [[basic.lookup]] in the
|
| 23 |
+
importing translation unit and declarations within the imported
|
| 24 |
+
translation units become reachable [[module.reach]] in the importing
|
| 25 |
+
translation unit after the import declaration. — *end note*]
|
| 26 |
|
| 27 |
A *module-import-declaration* that specifies a *module-name* `M` imports
|
| 28 |
all module interface units of `M`.
|
| 29 |
|
| 30 |
A *module-import-declaration* that specifies a *module-partition* shall
|
|
|
|
| 57 |
header. — *end note*]
|
| 58 |
|
| 59 |
[*Note 4*: A *module-import-declaration* nominating a *header-name* is
|
| 60 |
also recognized by the preprocessor, and results in macros defined at
|
| 61 |
the end of phase 4 of translation of the header unit being made visible
|
| 62 |
+
as described in [[cpp.import]]. Any other *module-import-declaration*
|
| 63 |
+
does not make macros visible. — *end note*]
|
| 64 |
|
| 65 |
A declaration of a name with internal linkage is permitted within a
|
| 66 |
header unit despite all declarations being implicitly exported
|
| 67 |
[[module.interface]].
|
| 68 |
|
|
|
|
| 76 |
imports all translation units imported by exported
|
| 77 |
*module-import-declaration*s in T; such translation units are said to be
|
| 78 |
*exported* by T. Additionally, when a *module-import-declaration* in a
|
| 79 |
module unit of some module M imports another module unit U of M, it also
|
| 80 |
imports all translation units imported by non-exported
|
| 81 |
+
*module-import-declaration*s in the module unit purview of U.[^1]
|
| 82 |
+
|
| 83 |
+
These rules can in turn lead to the importation of yet more translation
|
| 84 |
+
units.
|
| 85 |
+
|
| 86 |
+
[*Note 6*: Such indirect importation does not make macros available,
|
| 87 |
+
because a translation unit is a sequence of tokens in translation phase
|
| 88 |
+
7 [[lex.phases]]. Macros can be made available by directly importing
|
| 89 |
+
header units as described in [[cpp.import]]. — *end note*]
|
| 90 |
|
| 91 |
A module implementation unit shall not be exported.
|
| 92 |
|
| 93 |
[*Example 1*:
|
| 94 |
|