tmp/tmpyfz7on6w/{from.md → to.md}
RENAMED
|
@@ -17,18 +17,18 @@ unit that can affect the behavior of other translation units. A
|
|
| 17 |
*private-module-fragment* allows a module to be represented as a single
|
| 18 |
translation unit without making all of the contents of the module
|
| 19 |
reachable to importers. The presence of a *private-module-fragment*
|
| 20 |
affects:
|
| 21 |
|
| 22 |
-
- the point by which the definition of an
|
| 23 |
required [[dcl.inline]],
|
| 24 |
- the point by which the definition of an exported function with a
|
| 25 |
placeholder return type is required [[dcl.spec.auto]],
|
| 26 |
- whether a declaration is required not to be an exposure
|
| 27 |
[[basic.link]],
|
| 28 |
-
- where definitions for inline functions and templates must appear
|
| 29 |
-
[[basic.def.odr]], [[dcl.inline]], [[temp.pre]]
|
| 30 |
- the instantiation contexts of templates instantiated before it
|
| 31 |
[[module.context]], and
|
| 32 |
- the reachability of declarations within it [[module.reach]].
|
| 33 |
|
| 34 |
— *end note*]
|
|
@@ -37,16 +37,15 @@ affects:
|
|
| 37 |
|
| 38 |
``` cpp
|
| 39 |
export module A;
|
| 40 |
export inline void fn_e(); // error: exported inline function fn_e not defined
|
| 41 |
// before private module fragment
|
| 42 |
-
inline void fn_m(); //
|
| 43 |
static void fn_s();
|
| 44 |
export struct X;
|
| 45 |
export void g(X *x) {
|
| 46 |
fn_s(); // OK, call to static function in same translation unit
|
| 47 |
-
fn_m(); // OK, call to module-linkage inline function
|
| 48 |
}
|
| 49 |
export X *factory(); // OK
|
| 50 |
|
| 51 |
module :private;
|
| 52 |
struct X {}; // definition not reachable from importers of A
|
|
|
|
| 17 |
*private-module-fragment* allows a module to be represented as a single
|
| 18 |
translation unit without making all of the contents of the module
|
| 19 |
reachable to importers. The presence of a *private-module-fragment*
|
| 20 |
affects:
|
| 21 |
|
| 22 |
+
- the point by which the definition of an inline function or variable is
|
| 23 |
required [[dcl.inline]],
|
| 24 |
- the point by which the definition of an exported function with a
|
| 25 |
placeholder return type is required [[dcl.spec.auto]],
|
| 26 |
- whether a declaration is required not to be an exposure
|
| 27 |
[[basic.link]],
|
| 28 |
+
- where definitions for inline functions and templates must appear
|
| 29 |
+
[[basic.def.odr]], [[dcl.inline]], [[temp.pre]],
|
| 30 |
- the instantiation contexts of templates instantiated before it
|
| 31 |
[[module.context]], and
|
| 32 |
- the reachability of declarations within it [[module.reach]].
|
| 33 |
|
| 34 |
— *end note*]
|
|
|
|
| 37 |
|
| 38 |
``` cpp
|
| 39 |
export module A;
|
| 40 |
export inline void fn_e(); // error: exported inline function fn_e not defined
|
| 41 |
// before private module fragment
|
| 42 |
+
inline void fn_m(); // error: non-exported inline function fn_m not defined
|
| 43 |
static void fn_s();
|
| 44 |
export struct X;
|
| 45 |
export void g(X *x) {
|
| 46 |
fn_s(); // OK, call to static function in same translation unit
|
|
|
|
| 47 |
}
|
| 48 |
export X *factory(); // OK
|
| 49 |
|
| 50 |
module :private;
|
| 51 |
struct X {}; // definition not reachable from importers of A
|