From e32a313316cdcae9648236999e249459f5df76a0 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 15 Jan 2022 21:26:46 +0100 Subject: [PATCH 1/6] [macros] Introduce 'term.*' labels --- source/basic.tex | 7 ------- source/macros.tex | 23 ++++++++++++++++++++--- source/memory.tex | 2 +- tools/check-output.sh | 1 + 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index ab94c86677..22d2c61436 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -4604,7 +4604,6 @@ The \defnx{value representation}{representation!value} of an object of type \tcode{T} is the set of bits that participate in representing a value of type \tcode{T}. -\label{term.padding.bits}% Bits in the object representation that are not part of the value representation are \defn{padding bits}. For trivially copyable types, the value representation is @@ -4627,7 +4626,6 @@ The size and layout of an instance of an incompletely-defined object type is unknown. \end{footnote} -\label{term.incomplete.type}% Incompletely-defined object types and \cv{}~\keyword{void} are \defnadjx{incomplete}{types}{type}\iref{basic.fundamental}. \begin{note} @@ -4684,7 +4682,6 @@ \end{note} \pnum -\label{term.object.type}% An \defn{object type} is a (possibly cv-qualified) type that is not a function type, not a reference type, and not \cv{}~\keyword{void}. @@ -4692,7 +4689,6 @@ \indextext{class!trivial}% \indextext{class!trivially copyable}% \indextext{class!standard-layout}% -\label{term.scalar.type}% Arithmetic types\iref{basic.fundamental}, enumeration types, pointer types, pointer-to-member types\iref{basic.compound}, \tcode{std::nullptr_t}, @@ -4700,11 +4696,9 @@ cv-qualified\iref{basic.type.qualifier} versions of these types are collectively called \defnadjx{scalar}{types}{type}. -\label{term.trivially.copyable.type}% Scalar types, trivially copyable class types\iref{class.prop}, arrays of such types, and cv-qualified versions of these types are collectively called \defnadjx{trivially copyable}{types}{type}. -\label{term.trivial.type}% Scalar types, trivial class types\iref{class.prop}, arrays of such types and cv-qualified versions of these types are collectively called @@ -4719,7 +4713,6 @@ are collectively called \defnadjx{implicit-lifetime}{types}{type}. \pnum -\label{term.literal.type}% A type is a \defnadj{literal}{type} if it is: \begin{itemize} \item \cv{}~\keyword{void}; or diff --git a/source/macros.tex b/source/macros.tex index f7107b70bc..35cb3c80c0 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -237,16 +237,33 @@ \newcommand{\defnxname}[1]{\indextext{\idxxname{#1}}\xname{#1}} \newcommand{\defnlibxname}[1]{\indexlibrary{\idxxname{#1}}\xname{#1}} +% term.* labels +\newcommand{\termlabel}[1]{\label{term.\temp}} +% convert space-separated phrase to dot-separated label name +\newcommand{\newtermlabelx}[1]{% +{% remove all formatting instructions + \let\idxcode=\nocode% + \let\tcode=\nocode% + \let\idxgram=\nocode% + \let\fakegrammarterm=\nocode% + \let\Cpp=\idxCpp% + \let\oldconcept\oldconceptname% + \renewcommand{\ntbs}{ntbs}% + \renewcommand{\ntmbs}{ntmbs}% + \StrSubstitute{#1}{ }{.}[\temp]% + \termlabel{\temp}% +}} + % Non-compound defined term. \newcommand{\defn}[1]{\defnx{#1}{#1}} % Defined term with different index entry. -\newcommand{\defnx}[2]{\indexdefn{#2}\textit{#1}} +\newcommand{\defnx}[2]{\indexdefn{#2}\newtermlabelx{#2}\textit{#1}} % Compound defined term with 'see' for primary term. % Usage: \defnadj{trivial}{class} -\newcommand{\defnadj}[2]{\indextext{#1 #2|see{#2, #1}}\indexdefn{#2!#1}\textit{#1 #2}} +\newcommand{\defnadj}[2]{\defnadjx{#1}{#2}{#2}} % Compound defined term with a different form for the primary noun. % Usage: \defnadjx{scalar}{types}{type} -\newcommand{\defnadjx}[3]{\indextext{#1 #3|see{#3, #1}}\indexdefn{#3!#1}\textit{#1 #2}} +\newcommand{\defnadjx}[3]{\indextext{#1 #3|see{#3, #1}}\indexdefn{#3!#1}\newtermlabelx{#1 #3}\textit{#1 #2}} %%-------------------------------------------------- %% allow line break if needed for justification diff --git a/source/memory.tex b/source/memory.tex index 668bdf2667..2eaf8d8d8a 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -3073,7 +3073,7 @@ \pnum For the purposes of subclause \ref{smartptr}, a pointer type \tcode{Y*} is said to be -\defnx{compatible with}{compatible with!\idxcode{shared_ptr}} +\defnx{compatible with}{compatible with!\idxcode{\detokenize{shared_ptr}}} a pointer type \tcode{T*} when either \tcode{Y*} is convertible to \tcode{T*} or \tcode{Y} is \tcode{U[N]} and \tcode{T} is \cv{}~\tcode{U[]}. diff --git a/tools/check-output.sh b/tools/check-output.sh index 257ec2fd63..c128fae70d 100755 --- a/tools/check-output.sh +++ b/tools/check-output.sh @@ -37,6 +37,7 @@ rm -f tmp.txt # Find bad labels grep newlabel `ls *.aux | grep -v std.aux` | awk -F '{' '{ print $2 }' | sed 's/}//g' | sed 's/^tab://;s/fig://;s/idx.*\..//' | + grep -v '^term[.]' | # term.* labels are automated grep -v '^[a-z.0-9]*$' | sed 's/^\(.*\)$/bad label \1/' | fail || failed=1 From e3051c08886d4e5b262cd48f5528b9dd94269335 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 17 Jan 2022 08:49:16 +0100 Subject: [PATCH 2/6] [check] Fail on multiply defined labels --- tools/check-output.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/check-output.sh b/tools/check-output.sh index c128fae70d..21e08c4e7b 100755 --- a/tools/check-output.sh +++ b/tools/check-output.sh @@ -17,6 +17,9 @@ sed -n '/\.tex/{s/^.*\/\([-a-z0-9]\+\.tex\).*$/\1/;h}; /Overfull [\\][hv]box\|LaTeX Warning..Reference/{x;p;x;p}' std.log | sed '/^.\+\.tex$/{N;s/\n/:/}' | fail || failed=1 +grep "Label .* multiply defined" std.log | + fail || failed=1 + # Check for dangling "see" in general index (does not work with formatting) grep item < std-generalindex.ind | sed 's/,.*$//;s/\\[sub]*item //' | awk '/^ [^ ]/ { item=$0; print $0 } /^ [^ ]/ { subitem=$0; print item ", " $0 } /^ [^ ]/ { print item ", " subitem ", " $0 }' | From 74fd5315440859d33dd82d40e68cb194e3126dce Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 16 Jan 2022 09:22:21 +0100 Subject: [PATCH 3/6] [std] Fix multiply-defined term.* labels by creating unique index entries --- source/basic.tex | 12 +++++++----- source/classes.tex | 2 +- source/declarations.tex | 1 - source/expressions.tex | 14 +++++--------- source/iostreams.tex | 8 ++++---- source/iterators.tex | 4 ++-- source/macros.tex | 5 +++-- source/regex.tex | 2 +- source/templates.tex | 6 ++---- source/threads.tex | 5 +++-- source/utilities.tex | 5 +---- 11 files changed, 29 insertions(+), 35 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 22d2c61436..833294f2cd 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -870,8 +870,9 @@ \end{note} \pnum +\indexdefnadj{corresponding}{object parameter}% Two non-static member functions have -\defnadjx{corresponding}{object parameters}{object parameter} if: +\defnx{corresponding object parameters}{object parameter!corresponding!function} if: \begin{itemize} \item exactly one is an implicit object member function @@ -882,8 +883,9 @@ \item their object parameters have the same type. \end{itemize} +\indexdefnadj{corresponding}{object parameter}% Two non-static member function templates have -\defnadjx{corresponding}{object parameters}{object parameter} if: +\defnx{corresponding object parameters}{object parameter!corresponding!function template} if: \begin{itemize} \item exactly one is an implicit object member function @@ -2818,7 +2820,7 @@ \indextext{linkage|)} \pnum -A declaration $D$ \defnx{names}{name} an entity $E$ if +A declaration $D$ \defnx{names}{name (verb)} an entity $E$ if \begin{itemize} \item $D$ contains a \grammarterm{lambda-expression} whose closure type is $E$, @@ -4771,7 +4773,7 @@ \defnadjx{signed integer}{types}{type}. The range of representable values for a signed integer type is $-2^{N-1}$ to $2^{N-1}-1$ (inclusive), -where \placeholder{N} is called the \defn{width} of the type. +where \placeholder{N} is called the \defnx{width}{width!of integer type} of the type. \indextext{integral type!implementation-defined \tcode{sizeof}}% \begin{note} Plain \tcode{int}s are intended to have @@ -5071,7 +5073,7 @@ on the access to these entities\iref{class.access}; \item -\defnx{unions}{\idxcode{union}}, which are classes capable of containing objects of +\emph{unions}, which are classes capable of containing objects of different types at different times, \ref{class.union}; \item diff --git a/source/classes.tex b/source/classes.tex index fa73256323..14bed16efb 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -2819,7 +2819,7 @@ the bit-field semantic property is not part of the type of the class member. The \grammarterm{constant-expression} shall be an integral constant expression with a value greater than or equal to zero and -is called the \defn{width} of the bit-field. +is called the \defnx{width}{width!of bit-field} of the bit-field. If the width of a bit-field is larger than the width of the bit-field's type (or, in case of an enumeration type, of its underlying type), diff --git a/source/declarations.tex b/source/declarations.tex index 5cbc237f24..4a2bdf892a 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -3174,7 +3174,6 @@ \pnum \indextext{declaration!array}% -\label{term.array.type}% A type of the form ``array of \tcode{N} \tcode{U}'' or ``array of unknown bound of \tcode{U}'' is an \defn{array type}. The optional \grammarterm{attribute-specifier-seq} diff --git a/source/expressions.tex b/source/expressions.tex index 30fe24187e..b783478862 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -426,7 +426,6 @@ \rSec2[expr.context]{Context dependence} \pnum -\label{term.unevaluated.operand}% In some contexts, \defnx{unevaluated operands}{unevaluated operand} appear\iref{expr.prim.req, expr.typeid, @@ -5936,7 +5935,7 @@ \pnum Abbreviating \grammarterm{pm-expression}\tcode{.*}\grammarterm{cast-expression} as \tcode{E1.*E2}, \tcode{E1} -is called the \defn{object expression}. +is called the \defnx{object expression}{object expression!pointer-to-member operator}. If the dynamic type of \tcode{E1} does not contain the member to which \tcode{E2} refers, the behavior is undefined. @@ -7141,12 +7140,9 @@ semantics depending on whether or not an expression satisfies these requirements. Expressions that satisfy these requirements, assuming that copy elision\iref{class.copy.elision} is not performed, -are called -\indexdefn{expression!constant}% -\defnx{constant expressions}{constant expression}. +are called constant expressions. \begin{note} -Constant expressions can be evaluated -during translation. +Constant expressions can be evaluated during translation. \end{note} \begin{bnf} @@ -7183,14 +7179,14 @@ \pnum A constant-initialized potentially-constant variable $V$ is -\defn{usable in constant expressions} at a point $P$ if +\defnx{usable in constant expressions}{usable in constant expressions!variable} at a point $P$ if $V$'s initializing declaration $D$ is reachable from $P$ and \begin{itemize} \item $V$ is constexpr, \item $V$ is not initialized to a TU-local value, or \item $P$ is in the same translation unit as $D$. \end{itemize} -An object or reference is \defn{usable in constant expressions} if it is +An object or reference is \defnx{usable in constant expressions}{usable in constant expressions!object or reference} if it is \begin{itemize} \item a variable that is usable in constant expressions, or \item a template parameter object\iref{temp.param}, or diff --git a/source/iostreams.tex b/source/iostreams.tex index e7fa8f0516..9e30095cf0 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -12327,11 +12327,11 @@ a file within a file system that acts as a container of directory entries that contain information about other files, possibly including other directory files. -The \defn{parent directory} of a directory is +The \defnx{parent directory}{parent directory!directory} of a directory is the directory that both contains a directory entry for the given directory and is represented by the dot-dot filename\iref{fs.path.generic} in the given directory. -The \defn{parent directory} +The \defnx{parent directory}{parent directory!file} of other types of files is a directory containing a directory entry for the file under discussion. @@ -13198,10 +13198,10 @@ \rSec4[fs.path.type.cvt]{Type and encoding conversions} \pnum -The \defn{native encoding} of an ordinary character string is +The \defnx{native encoding}{native encoding!ordinary character string} of an ordinary character string is the operating system dependent current encoding for pathnames\iref{fs.class.path}. -The \defn{native encoding} for wide character strings is +The \defnx{native encoding}{native encoding!wide character string} for wide character strings is the implementation-defined execution wide-character set encoding\iref{character.seq}. diff --git a/source/iterators.tex b/source/iterators.tex index 14e44f0150..b82ce3f774 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1766,7 +1766,7 @@ \pnum Two dereferenceable iterators \tcode{a} and \tcode{b} of type \tcode{X} -offer the \defn{multi-pass guarantee} if: +offer the \defnx{multi-pass guarantee}{multi-pass guarantee!\detokenize{forward_iterator}} if: \begin{itemize} \item \tcode{a == b} implies \tcode{++a == ++b} and \item the expression @@ -2184,7 +2184,7 @@ \pnum Two dereferenceable iterators \tcode{a} and \tcode{b} of type \tcode{X} offer the -\defn{multi-pass guarantee} if: +\defnx{multi-pass guarantee}{multi-pass guarantee!\oldconcept{ForwardIterator}} if: \begin{itemize} \item \tcode{a == b} implies \tcode{++a == ++b} and \item \tcode{X} is a pointer type or the expression diff --git a/source/macros.tex b/source/macros.tex index 35cb3c80c0..5c5e81e2cc 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -167,6 +167,7 @@ } \newcommand{\indexdefn}[1]{\indextext{#1}} +\newcommand{\indexdefnadj}[2]{\indextext{#1 #2|see{#2, #1}}\indexdefn{#2!#1}} \newcommand{\idxbfpage}[1]{\textbf{\hyperpage{#1}}} \newcommand{\indexgrammar}[1]{\indextext{#1}\indexgram{#1|idxbfpage}} % This command uses the "cooked" \indeximpldef command to emit index @@ -238,7 +239,7 @@ \newcommand{\defnlibxname}[1]{\indexlibrary{\idxxname{#1}}\xname{#1}} % term.* labels -\newcommand{\termlabel}[1]{\label{term.\temp}} +\newcommand{\termlabel}[1]{\label{term.#1}} % convert space-separated phrase to dot-separated label name \newcommand{\newtermlabelx}[1]{% {% remove all formatting instructions @@ -263,7 +264,7 @@ \newcommand{\defnadj}[2]{\defnadjx{#1}{#2}{#2}} % Compound defined term with a different form for the primary noun. % Usage: \defnadjx{scalar}{types}{type} -\newcommand{\defnadjx}[3]{\indextext{#1 #3|see{#3, #1}}\indexdefn{#3!#1}\newtermlabelx{#1 #3}\textit{#1 #2}} +\newcommand{\defnadjx}[3]{\indexdefnadj{#1}{#3}\newtermlabelx{#1 #3}\textit{#1 #2}} %%-------------------------------------------------- %% allow line break if needed for justification diff --git a/source/regex.tex b/source/regex.tex index 5ee8aa28ed..287a760838 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -2116,7 +2116,7 @@ \pnum A default-constructed \tcode{match_results} object has no fully established result state. A -match result is \defn{ready} when, as a consequence of a completed regular expression match +match result is \defnx{ready}{ready!match result} when, as a consequence of a completed regular expression match modifying such an object, its result state becomes fully established. The effects of calling most member functions from a \tcode{match_results} object that is not ready are undefined. diff --git a/source/templates.tex b/source/templates.tex index dce8fc693d..bf662edf3b 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -3367,9 +3367,8 @@ \rSec3[temp.spec.partial.order]{Partial ordering of partial specializations} \pnum -\indextext{more specialized!class template}% For two partial specializations, -the first is \defn{more specialized} than the second if, given the following +the first is \defnx{more specialized}{more specialized!class template} than the second if, given the following rewrite to two function templates, the first function template is more specialized than the second according to the ordering rules for function templates\iref{temp.func.order}: @@ -7897,9 +7896,8 @@ \end{itemize} \pnum -\indextext{at least as specialized as|see{more specialized}}% Function template \tcode{F} -is \defnx{at least as specialized as}{more specialized} +is \defnx{at least as specialized as}{at least as specialized as|see{more specialized}} function template \tcode{G} if, for each pair of types used to determine the ordering, the type from \tcode{F} diff --git a/source/threads.tex b/source/threads.tex index 6a59070e5a..af1d0c3ee1 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -6456,7 +6456,8 @@ \indextext{block (execution)}% In addition to the exclusive lock ownership mode specified in~\ref{thread.mutex.requirements.mutex}, shared mutex types provide a -\defn{shared lock} ownership mode. Multiple execution agents can +\defnx{shared lock}{shared lock!ownership mode} ownership mode. +Multiple execution agents can simultaneously hold a shared lock ownership of a shared mutex type. But no execution agent holds a shared lock while another execution agent holds an exclusive lock on the same shared mutex type, and vice-versa. The maximum @@ -10042,7 +10043,7 @@ \end{itemize} \pnum -A shared state is \defn{ready} only if it holds a value or an exception ready for +A shared state is \defnx{ready}{ready!shared state} only if it holds a value or an exception ready for retrieval. Waiting for a shared state to become ready may invoke code to compute the result on the waiting thread if so specified in the description of the class or function that creates diff --git a/source/utilities.tex b/source/utilities.tex index 0ea252fc38..d211eb9dc4 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -9668,7 +9668,6 @@ \end{note} \pnum -\label{term.perfect.forwarding.call.wrapper}% A \defnadj{perfect forwarding}{call wrapper} is an argument forwarding call wrapper that forwards its state entities to the underlying call expression. @@ -9690,7 +9689,6 @@ with references as described in the corresponding forwarding steps. \pnum -\label{term.simple.call.wrapper}% A \defn{simple call wrapper} is a perfect forwarding call wrapper that meets the \oldconcept{CopyConstructible} and \oldconcept{CopyAssignable} requirements and whose copy constructor, move constructor, and assignment operators @@ -13858,8 +13856,7 @@ the field width is determined based on the content of the field. \pnum -\indextext{string!width}% -The \defn{width} of a string is defined as +The \defnx{width}{string!width} of a string is defined as the estimated number of column positions appropriate for displaying it in a terminal. \begin{note} From 95af9f6164841c6be546c654c46a6a2c4d3183c4 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 18 Jan 2022 21:09:09 +0100 Subject: [PATCH 4/6] [macros] Add \termref --- source/macros.tex | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/source/macros.tex b/source/macros.tex index 5c5e81e2cc..35439aa0dd 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -239,7 +239,15 @@ \newcommand{\defnlibxname}[1]{\indexlibrary{\idxxname{#1}}\xname{#1}} % term.* labels -\newcommand{\termlabel}[1]{\label{term.#1}} +\makeatletter +% define a label such that \titleref yields the name of the term +\newcommand{\termlabel}[2]{\@bsphack\begingroup% + \protected@edef\@currentlabel{\protect\M@TitleReference + {\@currentlabel}{#1}}% + \MNR@label{term.#2}% + \endgroup \@esphack}% +\makeatother + % convert space-separated phrase to dot-separated label name \newcommand{\newtermlabelx}[1]{% {% remove all formatting instructions @@ -251,8 +259,9 @@ \let\oldconcept\oldconceptname% \renewcommand{\ntbs}{ntbs}% \renewcommand{\ntmbs}{ntmbs}% + \edef\title{#1}% \StrSubstitute{#1}{ }{.}[\temp]% - \termlabel{\temp}% + \termlabel{\title}{\temp}% }} % Non-compound defined term. @@ -389,6 +398,14 @@ %% Inline non-parenthesized figure reference (override memoir's \fref) \renewcommand{\fref}[1]{\hyperref[fig:#1]{\figurerefname \nolinebreak[3] \ref*{fig:#1}}} +%% Inline reference to a defined term +\newcommand{\termrefx}[2]{\hyperref[term.#2]{#1}\iref{term.#2}} +\newcommand{\termref}[1]{\begingroup% +\StrSubstitute{#1}{ }{.}[\temp]% +\titleref{term.\temp}\iref{term.\temp}% +\endgroup% +} + %% NTBS, etc. \verbtocs{\StrTextsmaller}|\textsmaller[1]{| \verbtocs{\StrTextsc}|\textsc{| From 8448d68db82c8217c3d4c71e48bc8426520f1536 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 18 Jan 2022 21:54:26 +0100 Subject: [PATCH 5/6] [std] Use \termref throughout --- source/algorithms.tex | 2 +- source/basic.tex | 7 +++---- source/classes.tex | 20 ++++++++++---------- source/declarations.tex | 12 ++++++------ source/exceptions.tex | 2 +- source/expressions.tex | 26 +++++++++++++------------- source/future.tex | 2 +- source/iostreams.tex | 2 +- source/meta.tex | 4 ++-- source/ranges.tex | 10 +++++----- source/statements.tex | 2 +- source/support.tex | 2 +- source/templates.tex | 4 ++-- source/threads.tex | 2 +- source/time.tex | 10 +++++----- source/utilities.tex | 8 ++++---- 16 files changed, 57 insertions(+), 58 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 4c0f369fac..4991197835 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -10933,7 +10933,7 @@ \pnum \constraints The expression \tcode{::new (declval()) T(declval()...)} -is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}. +is well-formed when treated as an \termref{unevaluated operand}. \pnum \effects diff --git a/source/basic.tex b/source/basic.tex index 833294f2cd..29994506dd 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -437,7 +437,6 @@ \end{itemize} \pnum -\label{term.odr.use}% A variable is named by an expression if the expression is an \grammarterm{id-expression} that denotes it. A variable \tcode{x} whose name appears as a @@ -2861,7 +2860,7 @@ \item any reference to a non-volatile const object or reference with internal or no linkage initialized with a constant expression -that is not an odr-use\iref{term.odr.use}, +that is not an \termref{odr-use}, \end{itemize} or defines a constexpr variable initialized to a TU-local value (defined below). \begin{note} @@ -6554,7 +6553,7 @@ \pnum \indextext{non-initialization odr-use|see{odr-use, non-initialization}}% A \defnx{non-initialization odr-use}{odr-use!non-initialization} -is an odr-use\iref{term.odr.use} not caused directly or indirectly by +is an \termref{odr-use} not caused directly or indirectly by the initialization of a non-block static or thread storage duration variable. \pnum @@ -6571,7 +6570,7 @@ A non-block variable with static storage duration having initialization with side effects is initialized in this case, -even if it is not itself odr-used\iref{term.odr.use,basic.stc.static}. +even if it is not itself odr-used\iref{term.odr-use,basic.stc.static}. \end{footnote} It is \impldef{threads and program points at which deferred dynamic initialization is performed} in which threads and at which points in the program such deferred dynamic initialization occurs. diff --git a/source/classes.tex b/source/classes.tex index 14bed16efb..b86c5d9785 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -1030,7 +1030,7 @@ The implementation will implicitly declare these member functions for some class types when the program does not explicitly declare them. The implementation will implicitly define them -if they are odr-used\iref{term.odr.use} or +if they are \termrefx{odr-used}{odr-use} or needed for constant evaluation\iref{expr.const}. \end{note} An implicitly-declared special member function is declared at the closing @@ -1304,7 +1304,7 @@ that is defaulted and not defined as deleted is \defnx{implicitly defined}{constructor!implicitly defined} -when it is odr-used\iref{term.odr.use} +when it is \termrefx{odr-used}{odr-use} to initialize an object of its class type\iref{intro.object}, when it is needed for constant evaluation\iref{expr.const}, or when it is explicitly defaulted after its first declaration. @@ -1605,12 +1605,12 @@ that is defaulted and not defined as deleted is \term{implicitly defined} -when it is odr-used\iref{term.odr.use}, +when it is \termrefx{odr-used}{odr-use}, when it is needed for constant evaluation\iref{expr.const}, or when it is explicitly defaulted after its first declaration. \begin{note} The copy/move constructor is implicitly defined even if the implementation elided -its odr-use\iref{term.odr.use,class.temporary}. +its odr-use\iref{term.odr-use,class.temporary}. \end{note} If the implicitly-defined constructor would satisfy the requirements of a constexpr constructor\iref{dcl.constexpr}, the implicitly-defined @@ -1908,7 +1908,7 @@ that is defaulted and not defined as deleted is \term{implicitly defined} -when it is odr-used\iref{term.odr.use} +when it is \termrefx{odr-used}{odr-use} (e.g., when it is selected by overload resolution to assign to an object of its class type), when it is needed for constant evaluation\iref{expr.const}, or @@ -2066,7 +2066,7 @@ The program is ill-formed if overload resolution fails. Destructor selection does not constitute a reference to, -or odr-use\iref{term.odr.use} of, +or \termref{odr-use} of, the selected destructor, and in particular, the selected destructor may be deleted\iref{dcl.fct.def.delete}. @@ -2141,7 +2141,7 @@ that is defaulted and not defined as deleted is \defnx{implicitly defined}{destructor!implicitly defined} -when it is odr-used\iref{term.odr.use} +when it is \termrefx{odr-used}{odr-use} or when it is explicitly defaulted after its first declaration. \pnum @@ -2780,7 +2780,7 @@ \grammarterm{initializer-clause} that is an \grammarterm{assignment-expression} is a constant expression\iref{expr.const}. The member shall still be defined in a namespace scope if -it is odr-used\iref{term.odr.use} in the program and the +it is \termrefx{odr-used}{odr-use} in the program and the namespace scope definition shall not contain an \grammarterm{initializer}. The declaration of an inline static data member (which is a definition) may specify a \grammarterm{brace-or-equal-initializer}. If the @@ -2792,7 +2792,7 @@ \pnum \begin{note} There is exactly one definition of a static data member -that is odr-used\iref{term.odr.use} in a valid program. +that is \termrefx{odr-used}{odr-use} in a valid program. \end{note} \pnum @@ -3381,7 +3381,7 @@ called a \defnadj{local}{class}. \begin{note} A declaration in a local class -cannot odr-use\iref{term.odr.use} +cannot \termref{odr-use} a local entity from an enclosing scope. diff --git a/source/declarations.tex b/source/declarations.tex index 4a2bdf892a..f9a96a9e82 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -1580,8 +1580,8 @@ \item otherwise, \tcode{decltype($E$)} is the type of $E$. \end{itemize} -The operand of the \keyword{decltype} specifier is an unevaluated -operand\iref{term.unevaluated.operand}. +The operand of the \keyword{decltype} specifier is +an \termref{unevaluated operand}. \begin{example} \begin{codeblock} @@ -4124,7 +4124,7 @@ \pnum \begin{note} -A local variable cannot be odr-used\iref{term.odr.use} +A local variable cannot be \termrefx{odr-used}{odr-use} in a default argument. \end{note} \begin{example} @@ -4171,7 +4171,7 @@ int f(int a, int b = a); // error: parameter \tcode{a} used as default argument typedef int I; int g(float I, int b = I(2)); // error: parameter \tcode{I} found -int h(int a, int b = sizeof(a)); // OK, unevaluated operand\iref{term.unevaluated.operand} +int h(int a, int b = sizeof(a)); // OK, \termref{unevaluated operand} \end{codeblock} \end{example} A non-static member shall not appear in a default argument unless it appears as @@ -6182,7 +6182,7 @@ Implementations are permitted to provide additional predefined variables with names that are reserved to the implementation\iref{lex.name}. If a predefined variable is not -odr-used\iref{term.odr.use}, its string value need not be present in the program image. +\termrefx{odr-used}{odr-use}, its string value need not be present in the program image. \end{footnote} \begin{example} \begin{codeblock} @@ -6341,7 +6341,7 @@ function. It applies even for references in expressions that are not potentially-evaluated. For an overload set, only the function selected by overload resolution is referenced. The implicit -odr-use\iref{term.odr.use} of a virtual function does not, by itself, +\termref{odr-use} of a virtual function does not, by itself, constitute a reference. \end{note} diff --git a/source/exceptions.tex b/source/exceptions.tex index a436edfc57..70d889def5 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -941,7 +941,7 @@ \item in an expression, the function is selected by overload resolution\iref{over.match,over.over}; -\item the function is odr-used\iref{term.odr.use} or, if it appears in an +\item the function is \termrefx{odr-used}{odr-use} or, if it appears in an unevaluated operand, would be odr-used if the expression were potentially-evaluated; diff --git a/source/expressions.tex b/source/expressions.tex index b783478862..9d06112d20 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1385,7 +1385,7 @@ In the declaration of \tcode{p2}, those constraints are required to be satisfied even though -\tcode{f} is an unevaluated operand\iref{term.unevaluated.operand}. +\tcode{f} is an \termref{unevaluated operand}. \end{example} \end{note} @@ -2368,7 +2368,7 @@ \pnum An entity is \defn{captured} if it is captured explicitly or implicitly. An entity -captured by a \grammarterm{lambda-expression} is odr-used\iref{term.odr.use} by +captured by a \grammarterm{lambda-expression} is \termrefx{odr-used}{odr-use} by the \grammarterm{lambda-expression}. \begin{note} As a consequence, if a \grammarterm{lambda-expression} @@ -2473,7 +2473,7 @@ \pnum Every \grammarterm{id-expression} within the \grammarterm{compound-statement} of a -\grammarterm{lambda-expression} that is an odr-use\iref{term.odr.use} of an +\grammarterm{lambda-expression} that is an \termref{odr-use} of an entity captured by copy is transformed into an access to the corresponding unnamed data member of the closure type. \begin{note} @@ -2725,7 +2725,7 @@ A \grammarterm{requires-expression} is a prvalue of type \tcode{bool} whose value is described below. Expressions appearing within a \grammarterm{requirement-body} -are unevaluated operands\iref{term.unevaluated.operand}. +are \termrefx{unevaluated operands}{unevaluated.operand}. \pnum \begin{example} @@ -2812,7 +2812,7 @@ \begin{note} The enclosing \grammarterm{requires-expression} will evaluate to \keyword{false} if substitution of template arguments into the \grammarterm{expression} fails. -The \grammarterm{expression} is an unevaluated operand\iref{term.unevaluated.operand}. +The \grammarterm{expression} is an \termref{unevaluated operand}. \end{note} \begin{example} \begin{codeblock} @@ -2987,7 +2987,7 @@ \end{example} \pnum -A local parameter shall only appear as an unevaluated operand\iref{term.unevaluated.operand} +A local parameter shall only appear as an \termref{unevaluated operand} within the \grammarterm{constraint-expression}. \begin{example} \begin{codeblock} @@ -3805,7 +3805,7 @@ If the expression is a prvalue, the temporary materialization conversion\iref{conv.rval} is applied. -The expression is an unevaluated operand\iref{term.unevaluated.operand}. +The expression is an \termref{unevaluated operand}. \pnum When \keyword{typeid} is applied to a \grammarterm{type-id}, the result @@ -4800,7 +4800,7 @@ The \keyword{sizeof} operator yields the number of bytes occupied by a non-potentially-overlapping object of the type of its operand. The operand is either an expression, -which is an unevaluated operand\iref{term.unevaluated.operand}, or a parenthesized +which is an \termref{unevaluated operand}, or a parenthesized \grammarterm{type-id}. \indextext{type!incomplete}% The \keyword{sizeof} operator shall not be applied to an expression that @@ -4915,7 +4915,7 @@ \indextext{\idxcode{noexcept}}% \indextext{expression!\idxcode{noexcept}}% The \keyword{noexcept} operator determines whether the evaluation of its operand, -which is an unevaluated operand\iref{term.unevaluated.operand}, can throw an +which is an \termref{unevaluated operand}, can throw an exception\iref{except.throw}. \begin{bnf} @@ -7039,7 +7039,7 @@ A simple assignment whose left operand is of a volatile-qualified type is deprecated\iref{depr.volatile.type} unless the (possibly parenthesized) assignment is a discarded-value expression or -an unevaluated operand\iref{term.unevaluated.operand}. +an \termref{unevaluated operand}. \pnum The behavior of an expression of the form \tcode{E1 \placeholder{op}= E2} @@ -7295,7 +7295,7 @@ a reference to \keyword{this} or to a variable with automatic storage duration defined outside that \grammarterm{lambda-expression}, where -the reference would be an odr-use\iref{term.odr.use,expr.prim.lambda}; +the reference would be an odr-use\iref{term.odr-use,expr.prim.lambda}; \begin{example} \begin{codeblock} void g() { @@ -7666,7 +7666,7 @@ \end{itemize} \begin{note} A manifestly constant-evaluated expression -is evaluated even in an unevaluated operand\iref{term.unevaluated.operand}. +is evaluated even in an \termref{unevaluated operand}. \end{note} \pnum @@ -7696,7 +7696,7 @@ \item a subexpression of one of the above -that is not a subexpression of a nested unevaluated operand\iref{term.unevaluated.operand}. +that is not a subexpression of a nested \termref{unevaluated operand}. \end{itemize} \indextext{function!needed for constant evaluation}% diff --git a/source/future.tex b/source/future.tex index 17bd08d0ea..19a7f19f1e 100644 --- a/source/future.tex +++ b/source/future.tex @@ -1505,7 +1505,7 @@ \pnum Let \tcode{TS} denote \tcode{tuple_size} of the cv-unqualified type \tcode{T}. If the expression \tcode{TS::value} is well-formed -when treated as an unevaluated operand\iref{term.unevaluated.operand}, +when treated as an \termref{unevaluated operand}, then specializations of each of the two templates meet the \oldconcept{TransformationTrait} requirements with a base characteristic of \tcode{integral_constant}. diff --git a/source/iostreams.tex b/source/iostreams.tex index 9e30095cf0..58d21be117 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -5669,7 +5669,7 @@ \pnum \constraints The expression \tcode{is >> std::forward(x)} is well-formed -when treated as an unevaluated operand\iref{term.unevaluated.operand} and +when treated as an \termref{unevaluated operand} and \tcode{Istream} is publicly and unambiguously derived from \tcode{ios_base}. \pnum diff --git a/source/meta.tex b/source/meta.tex index 6c6d7914fd..afef9a124e 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -780,7 +780,7 @@ For the purpose of defining the templates in this subclause, a function call expression \tcode{declval()} for any type \tcode{T} is considered to be a trivial\iref{term.trivial.type,special} function call -that is not an odr-use\iref{term.odr.use} of \tcode{declval} +that is not an \termref{odr-use} of \tcode{declval} in the context of the corresponding definition notwithstanding the restrictions of~\ref{declval}. @@ -1510,7 +1510,7 @@ For the purpose of defining the templates in this subclause, a function call expression \tcode{declval()} for any type \tcode{T} is considered to be a trivial\iref{term.trivial.type,special} function call -that is not an odr-use\iref{term.odr.use} of \tcode{declval} +that is not an \termref{odr-use} of \tcode{declval} in the context of the corresponding definition notwithstanding the restrictions of~\ref{declval}. diff --git a/source/ranges.tex b/source/ranges.tex index 9a3f2443ae..e6436fcd5c 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -528,7 +528,7 @@ \tcode{ranges::begin(E)} is ill-formed. \item - Otherwise, if \tcode{T} is an array type\iref{term.array.type} and + Otherwise, if \tcode{T} is an \termref{array type} and \tcode{remove_all_extents_t} is an incomplete type, \tcode{ranges::begin(E)} is ill-formed with no diagnostic required. @@ -594,7 +594,7 @@ \tcode{ranges::end(E)} is ill-formed. \item - Otherwise, if \tcode{T} is an array type\iref{term.array.type} and + Otherwise, if \tcode{T} is an \termref{array type} and \tcode{remove_all_extents_t} is an incomplete type, \tcode{ranges::end(E)} is ill-formed with no diagnostic required. @@ -707,7 +707,7 @@ \tcode{ranges::rbegin(E)} is ill-formed. \item - Otherwise, if \tcode{T} is an array type\iref{term.array.type} and + Otherwise, if \tcode{T} is an \termref{array type} and \tcode{remove_all_extents_t} is an incomplete type, \tcode{ranges::rbegin(E)} is ill-formed with no diagnostic required. @@ -776,7 +776,7 @@ \tcode{ranges::rend(E)} is ill-formed. \item - Otherwise, if \tcode{T} is an array type\iref{term.array.type} and + Otherwise, if \tcode{T} is an \termref{array type} and \tcode{remove_all_extents_t} is an incomplete type, \tcode{ranges::rend(E)} is ill-formed with no diagnostic required. @@ -1031,7 +1031,7 @@ \tcode{ranges::data(E)} is ill-formed. \item - Otherwise, if \tcode{T} is an array type\iref{term.array.type} and + Otherwise, if \tcode{T} is an \termref{array type} and \tcode{remove_all_extents_t} is an incomplete type, \tcode{ranges::data(E)} is ill-formed with no diagnostic required. diff --git a/source/statements.tex b/source/statements.tex index 65b4534ee1..547de3057c 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -268,7 +268,7 @@ \end{codeblock} \end{example} \begin{note} -Odr-uses\iref{term.odr.use} in a discarded statement do not require +\termrefx{Odr-uses}{odr-use} in a discarded statement do not require an entity to be defined. \end{note} A \keyword{case} or \keyword{default} label appearing within such an diff --git a/source/support.tex b/source/support.tex index 40ceef1aae..807321675c 100644 --- a/source/support.tex +++ b/source/support.tex @@ -5874,7 +5874,7 @@ initialization of a variable with static storage duration requiring dynamic initialization\iref{basic.start.dynamic,stmt.dcl} \begin{footnote} -Such initialization can occur because it is the first odr-use\iref{term.odr.use} of that variable. +Such initialization can occur because it is the first \termref{odr-use} of that variable. \end{footnote} ; or diff --git a/source/templates.tex b/source/templates.tex index bf662edf3b..59b2e9c02b 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -3547,7 +3547,7 @@ overload resolution of function template specializations with the same name. -If such a non-template function is odr-used\iref{term.odr.use} in a program, it must be defined; +If such a non-template function is \termrefx{odr-used}{odr-use} in a program, it must be defined; it will not be implicitly instantiated using the function template definition. \end{footnote} @@ -5839,7 +5839,7 @@ that is the subject of an explicit instantiation declaration is not a declared specialization; the intent is that it still be implicitly instantiated -when odr-used\iref{term.odr.use} +when \termrefx{odr-used}{odr-use} so that the body can be considered for inlining, but that no out-of-line copy of it be generated in the translation unit. \end{note} diff --git a/source/threads.tex b/source/threads.tex index af1d0c3ee1..6f49e87a1f 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -11319,7 +11319,7 @@ \pnum \constraints \tcode{\&F::operator()} is well-formed when -treated as an unevaluated operand\iref{term.unevaluated.operand} and +treated as an \termref{unevaluated operand} and \tcode{decltype(\brk{}\&F::operator())} is of the form \tcode{R(G::*)(A...)}~\cv{}~\tcode{\opt{\&}~\opt{noexcept}} for a class type \tcode{G}. diff --git a/source/time.tex b/source/time.tex index 667d1fc334..3f07881b07 100644 --- a/source/time.tex +++ b/source/time.tex @@ -1196,7 +1196,7 @@ are valid and each denotes a type\iref{temp.deduct}, \item the expression \tcode{T::is_steady} -is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}, +is well-formed when treated as an \termref{unevaluated operand}, \item the expression \tcode{T::now()} is well-formed when treated as an unevaluated operand. @@ -11023,7 +11023,7 @@ \begin{codeblock} from_stream(declval&>(), @$F$@, tp) \end{codeblock} -is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}. +is well-formed when treated as an \termref{unevaluated operand}. \pnum \returns @@ -11056,7 +11056,7 @@ \begin{codeblock} from_stream(declval&>(), @$F$@, tp, addressof(abbrev)) \end{codeblock} -is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}. +is well-formed when treated as an \termref{unevaluated operand}. \pnum \returns @@ -11093,7 +11093,7 @@ declval*>(), &offset) \end{codeblock} -is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}. +is well-formed when treated as an \termref{unevaluated operand}. \pnum \returns @@ -11133,7 +11133,7 @@ from_stream(declval&>(), @$F$@, tp, addressof(abbrev), &offset) \end{codeblock} -is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}. +is well-formed when treated as an \termref{unevaluated operand}. \pnum \returns diff --git a/source/utilities.tex b/source/utilities.tex index d211eb9dc4..9467e9ebf1 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -430,7 +430,7 @@ \pnum The library provides the function template \tcode{declval} to simplify the definition of -expressions which occur as unevaluated operands\iref{term.unevaluated.operand}. +expressions which occur as \termrefx{unevaluated operands}{unevaluated.operand}. \indexlibraryglobal{declval}% \begin{itemdecl} @@ -440,7 +440,7 @@ \begin{itemdescr} \pnum \mandates -This function is not odr-used\iref{term.odr.use}. +This function is not \termrefx{odr-used}{odr-use}. \pnum \remarks @@ -2458,7 +2458,7 @@ \pnum Let \tcode{TS} denote \tcode{tuple_size} of the cv-unqualified type \tcode{T}. If the expression \tcode{TS::value} is well-formed -when treated as an unevaluated operand\iref{term.unevaluated.operand}, then +when treated as an \termref{unevaluated operand}, then each specialization of the template meets the \oldconcept{Unary\-Type\-Trait} requirements\iref{meta.rqmts} with a base characteristic of \begin{codeblock} @@ -15137,7 +15137,7 @@ typename Context::template formatter_type>() .format(declval(), declval()) \end{codeblock} -shall be well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}. +shall be well-formed when treated as an \termref{unevaluated operand}. \pnum \effects From 88b4ccdbc3fa6dfa2197be0b29222c61606da360 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 22 Feb 2022 17:03:34 +0100 Subject: [PATCH 6/6] [temp.spec.partial.order] Fix index entry: 'more specialized' The phrase 'more specialized' also applies to variable templates, not just to class templates. --- source/templates.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/templates.tex b/source/templates.tex index 59b2e9c02b..47d84f9ff9 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -3368,7 +3368,7 @@ \pnum For two partial specializations, -the first is \defnx{more specialized}{more specialized!class template} than the second if, given the following +the first is \defn{more specialized} than the second if, given the following rewrite to two function templates, the first function template is more specialized than the second according to the ordering rules for function templates\iref{temp.func.order}: