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.fundamental] Itemize uses of void expressions #6465

Merged
merged 2 commits into from
Jul 29, 2024
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
24 changes: 14 additions & 10 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5165,17 +5165,21 @@
A type \cv{}~\keyword{void}
is an incomplete type that cannot be completed; such a type has
an empty set of values. It is used as the return
type for functions that do not return a value. Any expression can be
explicitly converted to type
\cv{}~\keyword{void}\iref{expr.type.conv,expr.static.cast,expr.cast}.
type for functions that do not return a value.
An expression of type \cv{}~\keyword{void} shall
be used only as an expression statement\iref{stmt.expr}, as an operand
of a comma expression\iref{expr.comma}, as a second or third operand
of \tcode{?:}\iref{expr.cond}, as the operand of
\keyword{typeid}, \keyword{noexcept}, or \keyword{decltype}, as
the expression in a \keyword{return} statement\iref{stmt.return} for a function
with the return type \cv{}~\keyword{void}, or as the operand of an explicit conversion
to type \cv{}~\keyword{void}.
be used only as
\begin{itemize}
\item an expression statement\iref{stmt.expr},
\item the expression in a \keyword{return} statement\iref{stmt.return}
for a function with the return type \cv{}~\keyword{void},
\item an operand of a comma expression\iref{expr.comma},
\item the second or third operand of \tcode{?:}\iref{expr.cond},
\item the operand of a \keyword{typeid} expression\iref{expr.typeid},
\item the operand of a \keyword{noexcept} operator\iref{expr.unary.noexcept},
\item the operand of a \keyword{decltype} specifier\iref{dcl.type.decltype}, or
\item the operand of an explicit conversion to type
\cv{}~\keyword{void}\iref{expr.type.conv,expr.static.cast,expr.cast}.
\end{itemize}

\pnum
A value of type \tcode{std::nullptr_t} is a null pointer
Expand Down