|
196 | 196 |
|
197 | 197 | \begin{bnf} |
198 | 198 | \nontermdef{export-declaration}\br |
199 | | - \keyword{export} declaration\br |
| 199 | + \keyword{export} name-declaration\br |
200 | 200 | \keyword{export} \terminal{\{} \opt{declaration-seq} \terminal{\}}\br |
201 | 201 | export-keyword module-import-declaration |
202 | 202 | \end{bnf} |
|
209 | 209 | or a \grammarterm{private-module-fragment}. |
210 | 210 | An \grammarterm{export-declaration} |
211 | 211 | has the declarative effects of its |
212 | | -\grammarterm{declaration}, |
| 212 | +\grammarterm{name-declaration}, |
213 | 213 | \grammarterm{declaration-seq} (if any), or |
214 | 214 | \grammarterm{module-import-declaration}. |
215 | | -The \grammarterm{declaration} or \grammarterm{declaration-seq} of |
| 215 | +The \grammarterm{name-declaration} of an \grammarterm{export-declaration} |
| 216 | +shall not declare a partial specialization\iref{temp.decls.general}. |
| 217 | +The \grammarterm{declaration-seq} of |
216 | 218 | an \grammarterm{export-declaration} |
217 | 219 | shall not contain an \grammarterm{export-declaration} or |
218 | 220 | \grammarterm{module-import-declaration}. |
|
232 | 234 | \end{itemize} |
233 | 235 |
|
234 | 236 | \pnum |
235 | | -An exported declaration |
236 | | -that is not a \grammarterm{module-import-declaration} |
237 | | -shall declare at least one name. |
238 | | -If the declaration is not within a header unit, |
| 237 | +If an exported declaration is not within a header unit, |
239 | 238 | it shall not declare a name with internal linkage. |
240 | 239 |
|
241 | 240 | \pnum |
|
249 | 248 | #include "a.h" // error: declaration of \tcode{x} is not in the |
250 | 249 | // purview of a module interface unit |
251 | 250 | export module M; |
252 | | -export namespace {} // error: does not introduce any names |
253 | | -export namespace { |
254 | | - int a1; // error: export of name with internal linkage |
255 | | -} |
| 251 | +export namespace {} // error: namespace has internal linkage |
256 | 252 | namespace { |
257 | 253 | export int a2; // error: export of name with internal linkage |
258 | 254 | } |
259 | 255 | export static int b; // error: b explicitly declared static |
260 | 256 | export int f(); // OK |
261 | 257 | export namespace N { } // OK |
262 | | -export using namespace N; // error: does not declare a name |
| 258 | +export using namespace N; // OK |
263 | 259 | \end{codeblocktu} |
264 | 260 | \end{example} |
265 | 261 |
|
|
0 commit comments