Skip to content

Commit 905ec22

Browse files
committed
CWG2990 Exporting redeclarations of namespaces
1 parent 673143f commit 905ec22

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/modules.tex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,20 @@
312312
A redeclaration of an entity $X$
313313
is implicitly exported
314314
if $X$ was introduced by an exported declaration;
315-
otherwise it shall not be exported if it is attached to a named module.
315+
otherwise it shall not be exported unless it is a namespace.
316316
\begin{example}
317317
\begin{codeblock}
318318
export module M;
319319
struct S { int n; };
320320
typedef S S;
321321
export typedef S S; // OK, does not redeclare an entity
322322
export struct S; // error: exported declaration follows non-exported declaration
323+
namespace N { // external linkage, attached to global module, not exported
324+
void f();
325+
}
326+
namespace N { // OK, exported namespace redeclaring non-exported namespace
327+
export void g();
328+
}
323329
\end{codeblock}
324330
\end{example}
325331

0 commit comments

Comments
 (0)