Skip to content

Commit d0d38dd

Browse files
jensmaurerzygoloid
authored andcommitted
P1811R0 Relaxing redefinition restrictions for re-exportation robustness
1 parent 7c58af8 commit d0d38dd

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

source/basic.tex

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,10 @@
276276
\rSec1[basic.def.odr]{One-definition rule}
277277

278278
\pnum
279-
A variable, function, class type, enumeration type, template,
279+
No translation unit shall contain more than one definition of any
280+
variable, function, class type, enumeration type, template,
280281
default argument for a parameter (for a function in a given scope), or
281-
default template argument
282-
shall not be defined where a prior definition is necessarily reachable\iref{module.reach};
283-
no diagnostic is required if the prior declaration is in another translation unit.
282+
default template argument.
284283

285284
\pnum
286285
\indextext{expression!potentially evaluated}%
@@ -560,8 +559,7 @@
560559
\item default template argument
561560
\end{itemize}
562561
in a program provided that
563-
no prior definition is necessarily reachable\iref{module.reach}
564-
at the point where a definition appears, and
562+
each definition appears in a different translation unit, and
565563
provided the definitions satisfy the following requirements.
566564
There shall not be more than one definition
567565
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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,10 @@
624624
\pnum
625625
If the header identified by the \grammarterm{header-name}
626626
denotes an importable header\iref{module.import},
627-
the preprocessing directive
627+
it is
628+
\impldef{whether source file inclusion of importable header
629+
is replaced with \tcode{import}}
630+
whether the preprocessing directive
628631
is instead replaced by the \grammarterm{preprocessing-token}{s}
629632
\begin{ncbnf}
630633
\terminal{import} header-name \terminal{;}
@@ -1703,6 +1706,7 @@
17031706
\defnxname{cpp_initializer_lists} & \tcode{200806L} \\ \rowsep
17041707
\defnxname{cpp_inline_variables} & \tcode{201606L} \\ \rowsep
17051708
\defnxname{cpp_lambdas} & \tcode{200907L} \\ \rowsep
1709+
\defnxname{cpp_modules} & \tcode{201907L} \\ \rowsep
17061710
\defnxname{cpp_namespace_attributes} & \tcode{201411L} \\ \rowsep
17071711
\defnxname{cpp_noexcept_function_type} & \tcode{201510L} \\ \rowsep
17081712
\defnxname{cpp_nontype_template_args} & \tcode{201411L} \\ \rowsep

0 commit comments

Comments
 (0)