Skip to content

LWG parts of P2996R13 Reflection for C++26 #8004

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
35 changes: 35 additions & 0 deletions source/compatibility.tex
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@
Valid \CppXXIII{} code using \keyword{contract_assert} as an identifier
is not valid in this revision of \Cpp{}.

\diffref{lex.operators}
\change
New operator \tcode{^^}.
\rationale
Required for new features.
\effect
Valid \CppXXIII{} that contains two consecutive \tcode{^} tokens
can be ill-formed in this revision of \Cpp{}.
\begin{example}
\begin{codeblock}
struct C { int operator^(int); };
int operator^(int (C::*p)(int), C);
int i = &C::operator^^C{}; // ill-formed; previously well-formed
\end{codeblock}
\end{example}

\rSec2[diff.cpp23.expr]{\ref{expr}: expressions}

\diffref{expr.arith.conv}
Expand Down Expand Up @@ -148,6 +164,23 @@
\end{codeblock}
\end{example}

\diffref{dcl.attr.grammar}
\change
New token \tcode{:]}.
\rationale
Required for new features.
\effect
Valid \CppXXIII{} that contained an \grammarterm{attribute-specifier}
with an \grammarterm{attribute-using-prefix}
but no attributes and no whitespace
is ill-formed in this revision of \Cpp{}.
\begin{example}
\begin{codeblock}
struct [[using CC:]] C; // ill-formed; previously well-formed
struct [[using DD: ]] D; // OK
\end{codeblock}
\end{example}

\rSec2[diff.cpp23.temp]{\ref{temp}: templates}

\diffref{temp.constr}
Expand Down Expand Up @@ -221,6 +254,8 @@
\libheaderref{hive},
\libheaderrefx{inplace_vector}{inplace.vector.syn},
\libheaderref{linalg},
%FIXME: \libheaderref{meta} after renaming to meta.syn
\libheaderrefx{meta}{meta.type.synop},
\libheaderref{rcu},
\libheaderref{simd},
\libheaderref{stdbit.h},
Expand Down
27 changes: 27 additions & 0 deletions source/lib-intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@
and also define the function as deleted.
\end{example}

\item
\constantwhen
the conditions that are required for a call to the function
to be a constant subexpression\iref{defns.const.subexpr}.

\item
\expects
conditions that the function assumes to hold whenever it is called;
Expand Down Expand Up @@ -454,6 +459,7 @@
Next, the semantics of the code sequence are determined by the
\Fundescx{Constraints},
\Fundescx{Mandates},
\Fundescx{Constant When},
\Fundescx{Preconditions},
\Fundescx{Hardened preconditions},
\Fundescx{Effects},
Expand Down Expand Up @@ -1248,6 +1254,7 @@
\tcode{<mdspan>} \\
\tcode{<memory>} \\
\tcode{<memory_resource>} \\
\tcode{<meta>} \\
\tcode{<mutex>} \\
\columnbreak
\tcode{<new>} \\
Expand Down Expand Up @@ -3082,6 +3089,26 @@
either a standard library non-static member function\iref{member.functions}
or an instantiation of a standard library member function template.

\pnum
Let \tcode{\placeholder{F}} denote
a standard library function or function template.
Unless \tcode{\placeholder{F}} is designated an addressable function,
it is unspecified if or how
a reflection value designating the associated entity can be formed.
%FIXME: Why is this not an example, but a note that begins with "For example"?
\begin{note}
For example, it is possible that \tcode{std::meta::members_of}
will not return reflections of standard library functions
that an implementation handles through an extra-linguistic mechanism.
\end{note}

\pnum
Let \tcode{\placeholder{F}} denote
a standard library class or class template specialization.
It is unspecified if or how
a reflection value can be formed to any private member of \tcode{\placeholder{F}},
or what the names of such members may be.

\pnum
A translation unit shall not declare namespace \tcode{std} to be an inline namespace\iref{namespace.def}.

Expand Down
4 changes: 4 additions & 0 deletions source/macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@
\newcommand{\required}{\Fundesc{Required behavior}}
\newcommand{\constraints}{\Fundesc{Constraints}}
\newcommand{\mandates}{\Fundesc{Mandates}}
\newcommand{\constantwhen}{\Fundesc{Constant When}}
\newcommand{\expects}{\Fundesc{Preconditions}}
\newcommand{\hardexpects}{\Fundesc{Hardened preconditions}}
\newcommand{\effects}{\Fundesc{Effects}}
Expand Down Expand Up @@ -465,6 +466,9 @@
\newcommand{\unspecuniqtype}{\UNSP{unspecified unique type}}
\newcommand{\unspecalloctype}{\UNSP{unspecified allocator type}}

%% Workaround for ^^ being interpreted as Unicode escape sequence in listings.
\newcommand{\reflexpr}[1]{\string^\string^#1}

%% Manual insertion of italic corrections, for aligning in the presence
%% of the above annotations.
\newlength{\itcorrwidth}
Expand Down
Loading
Loading