WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Changes from 2 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
9 changes: 5 additions & 4 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8431,9 +8431,10 @@
it has reference or non-volatile const-qualified integral or enumeration type.

\pnum
A constant-initialized potentially-constant variable $V$ is
\defn{usable in constant expressions} at a point $P$ if
$V$'s initializing declaration $D$ is reachable from $P$ and
A variable $V$ is
\defnx{usable in constant expressions}{usable in constant expressions!variable} at a point $P$ if
$V$ is constant-initialized and potentially-constant,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not obvious that the new restriction that $V$ is constant-initialized is editorial. What does this do? Also, doesn't this conclude from the first bullet that $V$ is constexpr or something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not obvious that the new restriction that V is constant-initialized is editorial.

That $V$ is constant-initialized is, in the strict reading of the old wording, a prerequisite for the definition to apply.

Also, doesn't this conclude from the first bullet that V is constexpr or something else?

It does not, because in

extern int &r0;
int &r = r0;
constexpr int &r2 = r;

r is potentially-constant and has an initializing declaration reachable from, and in the same translation unit as, the definition of r2.

$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
Expand All @@ -8458,7 +8459,7 @@
\item
a reference member of any of the above.
\end{itemize}
An object or reference is \defn{usable in constant expressions} at point $P$
An object or reference is \defnx{usable in constant expressions}{usable in constant expressions!object or reference} at point $P$
if it is an object or reference
that is potentially usable in constant expressions at $P$ and
is constexpr-representable at $P$.
Expand Down