Skip to content

Commit ed7cb02

Browse files
jensmaurertkoeppe
authored andcommitted
[basic.def.odr] Introduce label 'term.odr.use' and refer to it
instead of referring to 'basic.def.odr'. The latter breaks if we ever move the definition of 'odr-use', e.g. to a subclause.
1 parent e728746 commit ed7cb02

File tree

9 files changed

+28
-27
lines changed

9 files changed

+28
-27
lines changed

source/basic.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@
426426
\end{itemize}
427427

428428
\pnum
429+
\label{term.odr.use}%
429430
A variable is named by an expression
430431
if the expression is an \grammarterm{id-expression} that denotes it.
431432
A variable \tcode{x} whose name appears as a
@@ -2854,7 +2855,7 @@
28542855
\item
28552856
any reference to a non-volatile const object or reference
28562857
with internal or no linkage initialized with a constant expression
2857-
that is not an odr-use\iref{basic.def.odr},
2858+
that is not an odr-use\iref{term.odr.use},
28582859
\end{itemize}
28592860
or defines a constexpr variable initialized to a TU-local value (defined below).
28602861
\begin{note}
@@ -6540,7 +6541,7 @@
65406541
\pnum
65416542
\indextext{non-initialization odr-use|see{odr-use, non-initialization}}%
65426543
A \defnx{non-initialization odr-use}{odr-use!non-initialization}
6543-
is an odr-use\iref{basic.def.odr} not caused directly or indirectly by
6544+
is an odr-use\iref{term.odr.use} not caused directly or indirectly by
65446545
the initialization of a non-block static or thread storage duration variable.
65456546

65466547
\pnum
@@ -6557,7 +6558,7 @@
65576558
A non-block variable with static storage duration
65586559
having initialization
65596560
with side effects is initialized in this case,
6560-
even if it is not itself odr-used~(\ref{basic.def.odr}, \ref{basic.stc.static}).
6561+
even if it is not itself odr-used~(\ref{term.odr.use}, \ref{basic.stc.static}).
65616562
\end{footnote}
65626563
It is \impldef{threads and program points at which deferred dynamic initialization is performed}
65636564
in which threads and at which points in the program such deferred dynamic initialization occurs.

source/classes.tex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@
10301030
The implementation will implicitly declare these member functions for some class
10311031
types when the program does not explicitly declare them.
10321032
The implementation will implicitly define them
1033-
if they are odr-used\iref{basic.def.odr} or
1033+
if they are odr-used\iref{term.odr.use} or
10341034
needed for constant evaluation\iref{expr.const}.
10351035
\end{note}
10361036
An implicitly-declared special member function is declared at the closing
@@ -1303,7 +1303,7 @@
13031303
that is defaulted and not defined as deleted
13041304
is
13051305
\defnx{implicitly defined}{constructor!implicitly defined}
1306-
when it is odr-used\iref{basic.def.odr}
1306+
when it is odr-used\iref{term.odr.use}
13071307
to create an object of its class type\iref{intro.object},
13081308
when it is needed for constant evaluation\iref{expr.const}, or
13091309
when it is explicitly defaulted after its first declaration.
@@ -1611,12 +1611,12 @@
16111611
that is defaulted and not defined as deleted
16121612
is
16131613
\term{implicitly defined}
1614-
when it is odr-used\iref{basic.def.odr},
1614+
when it is odr-used\iref{term.odr.use},
16151615
when it is needed for constant evaluation\iref{expr.const}, or
16161616
when it is explicitly defaulted after its first declaration.
16171617
\begin{note}
16181618
The copy/move constructor is implicitly defined even if the implementation elided
1619-
its odr-use~(\ref{basic.def.odr}, \ref{class.temporary}).
1619+
its odr-use~(\ref{term.odr.use}, \ref{class.temporary}).
16201620
\end{note}
16211621
If the implicitly-defined constructor would satisfy the requirements of a
16221622
constexpr constructor\iref{dcl.constexpr}, the implicitly-defined
@@ -1912,7 +1912,7 @@
19121912
that is defaulted and not defined as deleted
19131913
is
19141914
\term{implicitly defined}
1915-
when it is odr-used\iref{basic.def.odr}
1915+
when it is odr-used\iref{term.odr.use}
19161916
(e.g., when it is selected by overload resolution
19171917
to assign to an object of its class type),
19181918
when it is needed for constant evaluation\iref{expr.const}, or
@@ -2070,7 +2070,7 @@
20702070
The program is ill-formed if overload resolution fails.
20712071
Destructor selection does not constitute
20722072
a reference to,
2073-
or odr-use\iref{basic.def.odr} of,
2073+
or odr-use\iref{term.odr.use} of,
20742074
the selected destructor,
20752075
and in particular,
20762076
the selected destructor may be deleted\iref{dcl.fct.def.delete}.
@@ -2140,7 +2140,7 @@
21402140
that is defaulted and not defined as deleted
21412141
is
21422142
\defnx{implicitly defined}{destructor!implicitly defined}
2143-
when it is odr-used\iref{basic.def.odr}
2143+
when it is odr-used\iref{term.odr.use}
21442144
or when it is explicitly defaulted after its first declaration.
21452145

21462146
\pnum
@@ -2747,7 +2747,7 @@
27472747
\grammarterm{initializer-clause} that is an \grammarterm{assignment-expression}
27482748
is a constant expression\iref{expr.const}.
27492749
The member shall still be defined in a namespace scope if
2750-
it is odr-used\iref{basic.def.odr} in the program and the
2750+
it is odr-used\iref{term.odr.use} in the program and the
27512751
namespace scope definition shall not contain an \grammarterm{initializer}.
27522752
The declaration of an inline static data member (which is a definition)
27532753
may specify a \grammarterm{brace-or-equal-initializer}. If the
@@ -2759,7 +2759,7 @@
27592759
\pnum
27602760
\begin{note}
27612761
There is exactly one definition of a static data member
2762-
that is odr-used\iref{basic.def.odr} in a valid program.
2762+
that is odr-used\iref{term.odr.use} in a valid program.
27632763
\end{note}
27642764

27652765
\pnum
@@ -3205,7 +3205,7 @@
32053205
called a \defnadj{local}{class}.
32063206
\begin{note}
32073207
A declaration in a local class
3208-
cannot odr-use\iref{basic.def.odr}
3208+
cannot odr-use\iref{term.odr.use}
32093209
a local entity
32103210
from an
32113211
enclosing scope.

source/declarations.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,7 +4124,7 @@
41244124

41254125
\pnum
41264126
\begin{note}
4127-
A local variable cannot be odr-used\iref{basic.def.odr}
4127+
A local variable cannot be odr-used\iref{term.odr.use}
41284128
in a default argument.
41294129
\end{note}
41304130
\begin{example}
@@ -6180,7 +6180,7 @@
61806180
Implementations are
61816181
permitted to provide additional predefined variables with names that are reserved to the
61826182
implementation\iref{lex.name}. If a predefined variable is not
6183-
odr-used\iref{basic.def.odr}, its string value need not be present in the program image.
6183+
odr-used\iref{term.odr.use}, its string value need not be present in the program image.
61846184
\end{footnote}
61856185
\begin{example}
61866186
\begin{codeblock}
@@ -6340,7 +6340,7 @@
63406340
function. It applies even for references in expressions that are not
63416341
potentially-evaluated. For an overload set, only the
63426342
function selected by overload resolution is referenced. The implicit
6343-
odr-use\iref{basic.def.odr} of a virtual function does not, by itself,
6343+
odr-use\iref{term.odr.use} of a virtual function does not, by itself,
63446344
constitute a reference.
63456345
\end{note}
63466346

source/exceptions.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@
943943
\item in an expression, the function is selected by
944944
overload resolution~(\ref{over.match}, \ref{over.over});
945945

946-
\item the function is odr-used\iref{basic.def.odr} or, if it appears in an
946+
\item the function is odr-used\iref{term.odr.use} or, if it appears in an
947947
unevaluated operand, would be odr-used if the expression were
948948
potentially-evaluated;
949949

source/expressions.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,7 @@
23382338

23392339
\pnum
23402340
An entity is \defn{captured} if it is captured explicitly or implicitly. An entity
2341-
captured by a \grammarterm{lambda-expression} is odr-used\iref{basic.def.odr} by
2341+
captured by a \grammarterm{lambda-expression} is odr-used\iref{term.odr.use} by
23422342
the \grammarterm{lambda-expression}.
23432343
\begin{note}
23442344
As a consequence, if a \grammarterm{lambda-expression}
@@ -2443,7 +2443,7 @@
24432443

24442444
\pnum
24452445
Every \grammarterm{id-expression} within the \grammarterm{compound-statement} of a
2446-
\grammarterm{lambda-expression} that is an odr-use\iref{basic.def.odr} of an
2446+
\grammarterm{lambda-expression} that is an odr-use\iref{term.odr.use} of an
24472447
entity captured by copy is transformed into an access to the corresponding unnamed data
24482448
member of the closure type.
24492449
\begin{note}
@@ -7265,7 +7265,7 @@
72657265
a reference to \keyword{this} or to a variable with
72667266
automatic storage duration defined outside that
72677267
\grammarterm{lambda-expression}, where
7268-
the reference would be an odr-use~(\ref{basic.def.odr}, \ref{expr.prim.lambda});
7268+
the reference would be an odr-use~(\ref{term.odr.use}, \ref{expr.prim.lambda});
72697269
\begin{example}
72707270
\begin{codeblock}
72717271
void g() {

source/statements.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
\end{codeblock}
269269
\end{example}
270270
\begin{note}
271-
Odr-uses\iref{basic.def.odr} in a discarded statement do not require
271+
Odr-uses\iref{term.odr.use} in a discarded statement do not require
272272
an entity to be defined.
273273
\end{note}
274274
A \keyword{case} or \keyword{default} label appearing within such an

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5858,7 +5858,7 @@
58585858
initialization of a variable with static storage duration
58595859
requiring dynamic initialization~(\ref{basic.start.dynamic}, \ref{stmt.dcl})
58605860
\begin{footnote}
5861-
Such initialization can occur because it is the first odr-use\iref{basic.def.odr} of that variable.
5861+
Such initialization can occur because it is the first odr-use\iref{term.odr.use} of that variable.
58625862
\end{footnote}
58635863
; or
58645864

source/templates.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3557,7 +3557,7 @@
35573557
overload resolution of
35583558
function template specializations
35593559
with the same name.
3560-
If such a non-template function is odr-used\iref{basic.def.odr} in a program, it must be defined;
3560+
If such a non-template function is odr-used\iref{term.odr.use} in a program, it must be defined;
35613561
it will not be implicitly instantiated using the function template definition.
35623562
\end{footnote}
35633563

@@ -5847,7 +5847,7 @@
58475847
that is the subject of an explicit instantiation declaration
58485848
is not a declared specialization;
58495849
the intent is that it still be implicitly instantiated
5850-
when odr-used\iref{basic.def.odr}
5850+
when odr-used\iref{term.odr.use}
58515851
so that the body can be considered for inlining,
58525852
but that no out-of-line copy of it be generated in the translation unit.
58535853
\end{note}

source/utilities.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@
442442
\begin{itemdescr}
443443
\pnum
444444
\mandates
445-
This function is not odr-used\iref{basic.def.odr}.
445+
This function is not odr-used\iref{term.odr.use}.
446446

447447
\pnum
448448
\remarks
@@ -17949,7 +17949,7 @@
1794917949
For the purpose of defining the templates in this subclause,
1795017950
a function call expression \tcode{declval<T>()} for any type \tcode{T}
1795117951
is considered to be a trivial~(\ref{basic.types}, \ref{special}) function call
17952-
that is not an odr-use\iref{basic.def.odr} of \tcode{declval}
17952+
that is not an odr-use\iref{term.odr.use} of \tcode{declval}
1795317953
in the context of the corresponding definition
1795417954
notwithstanding the restrictions of~\ref{declval}.
1795517955

@@ -18642,7 +18642,7 @@
1864218642
For the purpose of defining the templates in this subclause,
1864318643
a function call expression \tcode{declval<T>()} for any type \tcode{T}
1864418644
is considered to be a trivial~(\ref{basic.types}, \ref{special}) function call
18645-
that is not an odr-use\iref{basic.def.odr} of \tcode{declval}
18645+
that is not an odr-use\iref{term.odr.use} of \tcode{declval}
1864618646
in the context of the corresponding definition
1864718647
notwithstanding the restrictions of~\ref{declval}.
1864818648

0 commit comments

Comments
 (0)