Skip to content
Merged
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
104 changes: 52 additions & 52 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@
\grammarterm{using-directive}{s} are described in~\ref{namespace.udir}.
\end{note}

\pnum
\indextext{declaration}%
\indextext{scope}%
Certain declarations contain one or more scopes\iref{basic.scope.scope}.
Unless otherwise stated, utterances in
\ref{dcl.dcl} about components in, of, or contained by a
declaration or subcomponent thereof refer only to those components of
the declaration that are \emph{not} nested within scopes nested within
the declaration.

\pnum
A
\grammarterm{simple-declaration} or
Expand Down Expand Up @@ -120,18 +130,20 @@
\end{example}

\pnum
Except where otherwise specified, the meaning of an \grammarterm{attribute-declaration}
is \impldef{meaning of attribute declaration}.

\pnum
\indextext{declaration}%
\indextext{scope}%
Certain declarations contain one or more scopes\iref{basic.scope.scope}.
Unless otherwise stated, utterances in
\ref{dcl.dcl} about components in, of, or contained by a
declaration or subcomponent thereof refer only to those components of
the declaration that are \emph{not} nested within scopes nested within
the declaration.
If a \grammarterm{declarator-id} is a name, the
\grammarterm{init-declarator} and (hence) the declaration introduce that name.
\begin{note}
Otherwise, the \grammarterm{declarator-id} is
a \grammarterm{qualified-id} or
names a destructor or
its \grammarterm{unqualified-id} is a \grammarterm{template-id} and
no name is introduced.
\end{note}
The \grammarterm{defining-type-specifier}{s}\iref{dcl.type} in
the \grammarterm{decl-specifier-seq} and
the recursive \grammarterm{declarator} structure
describe a type\iref{dcl.meaning},
which is then associated with the \grammarterm{declarator-id}.

\pnum
\indextext{identifier}%
Expand All @@ -157,29 +169,6 @@
\end{codeblock}
\end{example}

\pnum
\indextext{\idxgram{static_assert}}%
In a \grammarterm{static_assert-declaration}, the
\grammarterm{constant-expression} shall be
a contextually converted constant expression
of type \tcode{bool}\iref{expr.const}.
If the value of the expression when
so converted is \tcode{true}, the declaration has no
effect. Otherwise, the program is ill-formed, and the resulting
diagnostic message\iref{intro.compliance} shall include the text of
the \grammarterm{string-literal}, if one is supplied,
except that characters not in the basic
source character set\iref{lex.charset} are not required to appear in
the diagnostic message.
\begin{example}
\begin{codeblock}
static_assert(sizeof(int) == sizeof(void*), "wrong pointer size");
\end{codeblock}
\end{example}

\pnum
An \grammarterm{empty-declaration} has no effect.

\pnum
A \grammarterm{simple-declaration} with an \grammarterm{identifier-list} is called
a \defn{structured binding declaration}\iref{dcl.struct.bind}.
Expand All @@ -196,22 +185,6 @@
where the
\grammarterm{assignment-expression} is of array or non-union class type.

\pnum
If a \grammarterm{declarator-id} is a name, the
\grammarterm{init-declarator} and (hence) the declaration introduce that name.
\begin{note}
Otherwise, the \grammarterm{declarator-id} is
a \grammarterm{qualified-id} or
names a destructor or
its \grammarterm{unqualified-id} is a \grammarterm{template-id} and
no name is introduced.
\end{note}
The \grammarterm{defining-type-specifier}{s}\iref{dcl.type} in
the \grammarterm{decl-specifier-seq} and
the recursive \grammarterm{declarator} structure
describe a type\iref{dcl.meaning},
which is then associated with the \grammarterm{declarator-id}.

\pnum
If the \grammarterm{decl-specifier-seq} contains the \tcode{typedef}
specifier, the declaration is called a \defnx{typedef declaration}{declaration!typedef}
Expand All @@ -231,7 +204,7 @@
\pnum
\indextext{definition!declaration as}%
Syntactic components beyond those found in the general form of
declaration are added to a function declaration to make a
\grammarterm{simple-declaration} are added to a function declaration to make a
\grammarterm{function-definition}. An object declaration, however, is also
a definition unless it contains the \tcode{extern} specifier and has no
initializer\iref{basic.def}.
Expand All @@ -249,6 +222,33 @@
\grammarterm{explicit-specialization}\iref{temp.expl.spec}.
\end{note}

\pnum
\indextext{\idxgram{static_assert}}%
In a \grammarterm{static_assert-declaration}, the
\grammarterm{constant-expression} shall be
a contextually converted constant expression
of type \tcode{bool}\iref{expr.const}.
If the value of the expression when
so converted is \tcode{true}, the declaration has no
effect. Otherwise, the program is ill-formed, and the resulting
diagnostic message\iref{intro.compliance} shall include the text of
the \grammarterm{string-literal}, if one is supplied,
except that characters not in the basic
source character set\iref{lex.charset} are not required to appear in
the diagnostic message.
\begin{example}
\begin{codeblock}
static_assert(sizeof(int) == sizeof(void*), "wrong pointer size");
\end{codeblock}
\end{example}

\pnum
An \grammarterm{empty-declaration} has no effect.

\pnum
Except where otherwise specified, the meaning of an \grammarterm{attribute-declaration}
is \impldef{meaning of attribute declaration}.

\rSec1[dcl.spec]{Specifiers}%

\rSec2[dcl.spec.general]{General}%
Expand Down