From Jason Turner

[module.interface]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpgllcoddv/{from.md → to.md} +13 -7
tmp/tmpgllcoddv/{from.md → to.md} RENAMED
@@ -57,13 +57,13 @@ export using namespace N; // OK
57
  ```
58
 
59
  — *end example*]
60
 
61
  If an exported declaration is a *using-declaration* [[namespace.udecl]]
62
- and is not within a header unit, all entities to which all of the
63
- *using-declarator*s ultimately refer (if any) shall have been introduced
64
- with a name having external linkage.
65
 
66
  [*Example 2*:
67
 
68
  Source file \`"b.h"\`
69
 
@@ -104,12 +104,12 @@ export using N::h; // error: #1 has internal linkage
104
 
105
  — *end example*]
106
 
107
  [*Note 2*:
108
 
109
- These constraints do not apply to type names introduced by `typedef`
110
- declarations and *alias-declaration*s.
111
 
112
  [*Example 3*:
113
 
114
  ``` cpp
115
  export module M;
@@ -121,20 +121,26 @@ export using T = S; // OK, exports name T denoting type S
121
 
122
  — *end note*]
123
 
124
  A redeclaration of an entity X is implicitly exported if X was
125
  introduced by an exported declaration; otherwise it shall not be
126
- exported.
127
 
128
  [*Example 4*:
129
 
130
  ``` cpp
131
  export module M;
132
  struct S { int n; };
133
  typedef S S;
134
- export typedef S S; // OK, does not redeclare an entity
135
  export struct S; // error: exported declaration follows non-exported declaration
 
 
 
 
 
 
136
  ```
137
 
138
  — *end example*]
139
 
140
  [*Note 3*: Names introduced by exported declarations have either
 
57
  ```
58
 
59
  — *end example*]
60
 
61
  If an exported declaration is a *using-declaration* [[namespace.udecl]]
62
+ and is not within a header unit, all entities named by the
63
+ *using-declarator*s (if any) shall either be a type alias or have been
64
+ introduced with a name having external linkage.
65
 
66
  [*Example 2*:
67
 
68
  Source file \`"b.h"\`
69
 
 
104
 
105
  — *end example*]
106
 
107
  [*Note 2*:
108
 
109
+ The underlying entity of an exported type alias need not have a name
110
+ with external linkage.
111
 
112
  [*Example 3*:
113
 
114
  ``` cpp
115
  export module M;
 
121
 
122
  — *end note*]
123
 
124
  A redeclaration of an entity X is implicitly exported if X was
125
  introduced by an exported declaration; otherwise it shall not be
126
+ exported unless it is a type alias, a namespace, or a namespace alias.
127
 
128
  [*Example 4*:
129
 
130
  ``` cpp
131
  export module M;
132
  struct S { int n; };
133
  typedef S S;
134
+ export typedef S S; // OK
135
  export struct S; // error: exported declaration follows non-exported declaration
136
+ namespace N { // external linkage, attached to global module, not exported
137
+ void f();
138
+ }
139
+ namespace N { // OK, exported namespace redeclaring non-exported namespace
140
+ export void g();
141
+ }
142
  ```
143
 
144
  — *end example*]
145
 
146
  [*Note 3*: Names introduced by exported declarations have either