Skip to content

P1811R0 Relaxing redefinition restrictions for re-exportation robustness #3087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2019
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
10 changes: 4 additions & 6 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,10 @@
\rSec1[basic.def.odr]{One-definition rule}

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

\pnum
\indextext{expression!potentially evaluated}%
Expand Down Expand Up @@ -560,8 +559,7 @@
\item default template argument
\end{itemize}
in a program provided that
no prior definition is necessarily reachable\iref{module.reach}
at the point where a definition appears, and
each definition appears in a different translation unit, and
provided the definitions satisfy the following requirements.
There shall not be more than one definition
of an entity
Expand Down
8 changes: 3 additions & 5 deletions source/modules.tex
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@
\item the point at the end of translation unit \#3, and
\item the point of the call to \tcode{g(0)},
\end{itemize}
so the definition of \tcode{X} is not necessarily reachable,
so the definition of \tcode{X} need not be reachable,
as described in \ref{module.reach}.
\end{example}

Expand Down Expand Up @@ -897,16 +897,14 @@

\pnum
A declaration $D$ is
\defnx{reachable}{reachable!declaration} or
\defnx{necessarily reachable}{reachable!necessarily!declaration},
respectively, if,
\defnx{reachable}{reachable!declaration}, if,
for any point $P$ in the
instantiation context\iref{module.context},
\begin{itemize}
\item $D$ appears prior to $P$ in the same translation unit, or
\item $D$ is not discarded\iref{module.global},
appears in a translation unit that is
reachable or necessarily reachable from $P$, respectively,
reachable from $P$,
and
either does not appear within a \grammarterm{private-module-fragment}
or appears in a \grammarterm{private-module-fragment}
Expand Down
6 changes: 5 additions & 1 deletion source/preprocessor.tex
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,10 @@
\pnum
If the header identified by the \grammarterm{header-name}
denotes an importable header\iref{module.import},
the preprocessing directive
it is
\impldef{whether source file inclusion of importable header
is replaced with \tcode{import}}
whether the preprocessing directive
is instead replaced by the \grammarterm{preprocessing-token}{s}
\begin{ncbnf}
\terminal{import} header-name \terminal{;}
Expand Down Expand Up @@ -1703,6 +1706,7 @@
\defnxname{cpp_initializer_lists} & \tcode{200806L} \\ \rowsep
\defnxname{cpp_inline_variables} & \tcode{201606L} \\ \rowsep
\defnxname{cpp_lambdas} & \tcode{200907L} \\ \rowsep
\defnxname{cpp_modules} & \tcode{201907L} \\ \rowsep
\defnxname{cpp_namespace_attributes} & \tcode{201411L} \\ \rowsep
\defnxname{cpp_noexcept_function_type} & \tcode{201510L} \\ \rowsep
\defnxname{cpp_nontype_template_args} & \tcode{201411L} \\ \rowsep
Expand Down