Skip to content

Commit 967e5dd

Browse files
committed
P1811R0 Relaxing redefinition restrictions for re-exportation robustness
1 parent 67db942 commit 967e5dd

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

source/basic.tex

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,8 @@
274274
\rSec1[basic.def.odr]{One-definition rule}
275275

276276
\pnum
277-
A variable, function, class type, enumeration type, or template
278-
shall not be defined where a prior definition is necessarily reachable\iref{module.reach};
279-
no diagnostic is required if the prior declaration is in another translation unit.
277+
No translation unit shall contain more than one definition of any
278+
variable, function, class type, enumeration type, or template.
280279

281280
\pnum
282281
\indextext{expression!potentially evaluated}%
@@ -550,8 +549,7 @@
550549
specialization for which some template parameters are not
551550
specified~(\ref{temp.spec}, \ref{temp.class.spec}) in a program
552551
provided that
553-
no prior definition is necessarily reachable\iref{module.reach}
554-
at the point where a definition appears, and
552+
each definition appears in a different translation unit, and
555553
provided the definitions satisfy the following requirements.
556554
There shall not be more than one definition
557555
of an entity

source/modules.tex

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@
858858
\item the point at the end of translation unit \#3, and
859859
\item the point of the call to \tcode{g(0)},
860860
\end{itemize}
861-
so the definition of \tcode{X} is not necessarily reachable,
861+
so the definition of \tcode{X} need not be reachable,
862862
as described in \ref{module.reach}.
863863
\end{example}
864864

@@ -897,16 +897,14 @@
897897

898898
\pnum
899899
A declaration $D$ is
900-
\defnx{reachable}{reachable!declaration} or
901-
\defnx{necessarily reachable}{reachable!necessarily!declaration},
902-
respectively, if,
900+
\defnx{reachable}{reachable!declaration}, if,
903901
for any point $P$ in the
904902
instantiation context\iref{module.context},
905903
\begin{itemize}
906904
\item $D$ appears prior to $P$ in the same translation unit, or
907905
\item $D$ is not discarded\iref{module.global},
908906
appears in a translation unit that is
909-
reachable or necessarily reachable from $P$, respectively,
907+
reachable from $P$,
910908
and
911909
either does not appear within a \grammarterm{private-module-fragment}
912910
or appears in a \grammarterm{private-module-fragment}

source/preprocessor.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@
621621
\pnum
622622
If the header identified by the \grammarterm{header-name}
623623
denotes an importable header\iref{module.import},
624+
it is implementation-defined whether
624625
the preprocessing directive
625626
is instead replaced by the \grammarterm{preprocessing-token}{s}
626627
\begin{ncbnf}
@@ -1700,6 +1701,7 @@
17001701
\defnxname{cpp_initializer_lists} & \tcode{200806L} \\ \rowsep
17011702
\defnxname{cpp_inline_variables} & \tcode{201606L} \\ \rowsep
17021703
\defnxname{cpp_lambdas} & \tcode{200907L} \\ \rowsep
1704+
\defnxname{cpp_modules} & \tcode{201907L} \\ \rowsep
17031705
\defnxname{cpp_namespace_attributes} & \tcode{201411L} \\ \rowsep
17041706
\defnxname{cpp_noexcept_function_type} & \tcode{201510L} \\ \rowsep
17051707
\defnxname{cpp_nontype_template_args} & \tcode{201411L} \\ \rowsep

0 commit comments

Comments
 (0)