Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
Every name is introduced by a \defn{declaration}, which is a
\begin{itemize}
\item
\grammarterm{declaration},
\grammarterm{name-declaration},
\grammarterm{block-declaration}, or
\grammarterm{member-declaration}\iref{dcl.pre,class.mem},
\item
Expand Down Expand Up @@ -1753,10 +1753,6 @@
if it precedes $P$ and inhabits either $S$ or
the scope of a namespace nominated by a \grammarterm{using-directive}
that is active in $S$ at $P$.
\begin{note}
A \grammarterm{using-directive} is exported if and only if
it appears in a header unit.
\end{note}

\pnum
An \term{unqualified search} in a scope $S$ from a program point $P$
Expand Down
21 changes: 14 additions & 7 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,31 @@

\begin{bnf}
\nontermdef{declaration}\br
name-declaration\br
special-declaration
\end{bnf}

\begin{bnf}
\nontermdef{name-declaration}\br
block-declaration\br
nodeclspec-function-declaration\br
function-definition\br
template-declaration\br
deduction-guide\br
explicit-instantiation\br
explicit-specialization\br
export-declaration\br
linkage-specification\br
namespace-definition\br
empty-declaration\br
attribute-declaration\br
module-import-declaration
\end{bnf}

\begin{bnf}
\nontermdef{special-declaration}\br
explicit-instantiation\br
explicit-specialization\br
export-declaration
\end{bnf}

\begin{bnf}
\nontermdef{block-declaration}\br
simple-declaration\br
Expand Down Expand Up @@ -8151,7 +8161,7 @@
\begin{bnf}
\nontermdef{linkage-specification}\br
\keyword{extern} string-literal \terminal{\{} \opt{declaration-seq} \terminal{\}}\br
\keyword{extern} string-literal declaration
\keyword{extern} string-literal name-declaration
\end{bnf}

The \grammarterm{string-literal} indicates the required language linkage.
Expand Down Expand Up @@ -8185,9 +8195,6 @@
\end{example}

\pnum
A \grammarterm{module-import-declaration}
shall not be directly contained in
a \grammarterm{linkage-specification}.
A \grammarterm{module-import-declaration} appearing in
a linkage specification with other than \Cpp{} language linkage
is conditionally-supported with
Expand Down
20 changes: 8 additions & 12 deletions source/modules.tex
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@

\begin{bnf}
\nontermdef{export-declaration}\br
\keyword{export} declaration\br
\keyword{export} name-declaration\br
\keyword{export} \terminal{\{} \opt{declaration-seq} \terminal{\}}\br
export-keyword module-import-declaration
\end{bnf}
Expand All @@ -209,10 +209,12 @@
or a \grammarterm{private-module-fragment}.
An \grammarterm{export-declaration}
has the declarative effects of its
\grammarterm{declaration},
\grammarterm{name-declaration},
\grammarterm{declaration-seq} (if any), or
\grammarterm{module-import-declaration}.
The \grammarterm{declaration} or \grammarterm{declaration-seq} of
The \grammarterm{name-declaration} of an \grammarterm{export-declaration}
shall not declare a partial specialization\iref{temp.decls.general}.
The \grammarterm{declaration-seq} of
an \grammarterm{export-declaration}
shall not contain an \grammarterm{export-declaration} or
\grammarterm{module-import-declaration}.
Expand All @@ -232,10 +234,7 @@
\end{itemize}

\pnum
An exported declaration
that is not a \grammarterm{module-import-declaration}
shall declare at least one name.
If the declaration is not within a header unit,
If an exported declaration is not within a header unit,
it shall not declare a name with internal linkage.

\pnum
Expand All @@ -249,17 +248,14 @@
#include "a.h" // error: declaration of \tcode{x} is not in the
// purview of a module interface unit
export module M;
export namespace {} // error: does not introduce any names
export namespace {
int a1; // error: export of name with internal linkage
}
export namespace {} // error: namespace has internal linkage
namespace {
export int a2; // error: export of name with internal linkage
}
export static int b; // error: b explicitly declared static
export int f(); // OK
export namespace N { } // OK
export using namespace N; // error: does not declare a name
export using namespace N; // OK
\end{codeblocktu}
\end{example}

Expand Down
2 changes: 2 additions & 0 deletions source/templates.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6379,6 +6379,8 @@
\end{example}

\pnum
The \grammarterm{declaration} in an \grammarterm{explicit-specialization}
shall not be an \grammarterm{export-declaration}.
An explicit specialization shall not use
a \grammarterm{storage-class-specifier}\iref{dcl.stc}
other than \keyword{thread_local}.
Expand Down