From 523cd092ef2013c451b9686fe1cfc9d718ac804f Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Sun, 27 Jul 2025 10:56:45 -0400 Subject: [PATCH] [basic.pre][basic.link] Names have linkage An essential property of names is that they have linkage. Move the statement that names have linkage up from [basic.link] to [basic.pre] where the term `name` is defined, and before the references to linkage of names in the clauses between [basic.pre] and [basic.link]. --- source/basic.tex | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 8ad496d3d6..4d11742c0d 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -36,6 +36,12 @@ \grammarterm{conversion-function-id}\iref{class.conv.fct}, \grammarterm{operator-function-id}\iref{over.oper}, or \grammarterm{literal-operator-id}\iref{over.literal}. +A name has +\defnadj{external}{linkage}, +\defnadj{module}{linkage}, +\defnadj{internal}{linkage}, or +\defnadj{no}{linkage}, +as determined by the rules in \ref{basic.link}. \pnum Two names are \defnx{the same}{name!same} if @@ -157,6 +163,12 @@ refer to the same entity in these translation units depending on the linkage\iref{basic.link} of the name specified in each translation unit. +\begin{note} +All declarations of an entity with a name with internal linkage +appear in the same translation unit. +All declarations of an entity with module linkage +are attached to the same module. +\end{note} \rSec1[basic.def]{Declarations and definitions} @@ -2875,6 +2887,7 @@ \pnum \indextext{program}% +\indextext{translation unit}% \indextext{linking}% A \defn{program} consists of one or more translation units\iref{lex.separate} linked together. A translation unit consists @@ -2886,21 +2899,6 @@ \opt{global-module-fragment} module-declaration \opt{declaration-seq} \opt{private-module-fragment} \end{bnf} -\pnum -\indextext{translation unit}% -A name has -\defnadj{external}{linkage}, -\defnadj{module}{linkage}, -\defnadj{internal}{linkage}, or -\defnadj{no}{linkage}, -as determined by the rules below. -\begin{note} -All declarations of an entity with a name with internal linkage -appear in the same translation unit. -All declarations of an entity with module linkage -are attached to the same module. -\end{note} - \pnum \indextext{linkage!\idxcode{static} and}% \indextext{\idxcode{static}!linkage of}%