Skip to content
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

[basic.pre] Defragment specification of names and entities #7122

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
75 changes: 37 additions & 38 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
\gramSec[gram.basic]{Basics}

\rSec1[basic.pre]{Preamble}
\indextext{type}%
\indextext{object}%
\indextext{storage class}%
\indextext{scope}%
\indextext{linkage}%

\pnum
\begin{note}
Expand All @@ -27,22 +32,22 @@
\end{note}

\pnum
\indextext{type}%
\indextext{object}%
\indextext{storage class}%
\indextext{scope}%
\indextext{linkage}%
An \defn{entity} is a value, object, reference,
structured binding,
function, enumerator, type,
class member, bit-field, template, template specialization, namespace, or
pack.
A \defn{name} is an \grammarterm{identifier}\iref{lex.name},
\grammarterm{conversion-function-id}\iref{class.conv.fct},
\grammarterm{operator-function-id}\iref{over.oper}, or
\grammarterm{literal-operator-id}\iref{over.literal}.

\pnum
A \defn{name} is an \grammarterm{identifier}\iref{lex.name},
\grammarterm{operator-function-id}\iref{over.oper},
\grammarterm{literal-operator-id}\iref{over.literal}, or
\grammarterm{conversion-function-id}\iref{class.conv.fct}.
Two names are \defnx{the same}{name!same} if
\begin{itemize}
\item they are \grammarterm{identifier}{s} composed of the same character sequence, or
\item they are \grammarterm{conversion-function-id}{s} formed with
equivalent\iref{temp.over.link} types, or
\item they are \grammarterm{operator-function-id}{s} formed with
the same operator, or
\item they are \grammarterm{literal-operator-id}{s} formed with
the same literal suffix identifier.
\end{itemize}

\pnum
Every name is introduced by a \defn{declaration}, which is a
Expand Down Expand Up @@ -85,44 +90,38 @@
The interpretation of a \grammarterm{for-range-declaration} produces
one or more of the above\iref{stmt.ranged}.
\end{note}
An entity $E$ is denoted by the name (if any)
that is introduced by a declaration of $E$ or
by a \grammarterm{typedef-name} introduced by a declaration specifying $E$.

\pnum
\begin{note}
Some names denote types or templates.
In general, whenever a name is encountered
it is necessary to look it up\iref{basic.lookup}
to determine whether that name denotes one of these entities
before continuing to parse the program that contains it.
\end{note}

\pnum
A \defn{variable} is introduced by the
declaration of
a reference other than a non-static data member or of
an object. The variable's name, if any, denotes the reference or object.

\pnum
An \defn{entity} is a value, object, reference,
structured binding,
function, enumerator, type,
class member, bit-field, template, template specialization, namespace, or
pack. An entity $E$ is denoted by the name (if any)
that is introduced by a declaration of $E$ or
by a \grammarterm{typedef-name} introduced by a declaration specifying $E$.

\pnum
A \defnadj{local}{entity} is a variable with
automatic storage duration\iref{basic.stc.auto},
a structured binding\iref{dcl.struct.bind}
whose corresponding variable is such an entity,
or the \tcode{*\keyword{this}} object\iref{expr.prim.this}.

\pnum
\begin{note}
Some names denote types or templates.
In general, whenever a name is encountered
it is necessary to look it up\iref{basic.lookup}
to determine whether that name denotes one of these entities
before continuing to parse the program that contains it.
\end{note}

\pnum
Two names are \defnx{the same}{name!same} if
\begin{itemize}
\item they are \grammarterm{identifier}{s} composed of the same character sequence, or
\item they are \grammarterm{operator-function-id}{s} formed with
the same operator, or
\item they are \grammarterm{conversion-function-id}{s} formed
with equivalent\iref{temp.over.link} types, or
\item they are \grammarterm{literal-operator-id}{s}\iref{over.literal} formed with
the same literal suffix identifier.
\end{itemize}

\pnum
\indextext{translation unit!name and}%
\indextext{linkage}%
Expand Down