Skip to content

P1161R3 Deprecate uses of the comma operator in subscripting expressions #3040

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

Merged
merged 1 commit into from
Aug 2, 2019
Merged
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
16 changes: 16 additions & 0 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2862,6 +2862,14 @@
if that operand is an lvalue and an xvalue otherwise.
The expression \tcode{E1} is sequenced before the expression \tcode{E2}.

\pnum
\begin{note}
A comma expression\iref{expr.comma}
appearing as the \grammarterm{expr-or-braced-init-list}
of a subscripting expression is deprecated;
see \ref{depr.comma.subscript}.
\end{note}

\pnum
\begin{note}
Despite its asymmetric appearance, subscripting is a commutative
Expand Down Expand Up @@ -6793,6 +6801,14 @@
\tcode{5}.
\end{example}

\pnum
\begin{note}
A comma expression
appearing as the \grammarterm{expr-or-braced-init-list}
of a subscripting expression\iref{expr.sub} is deprecated;
see \ref{depr.comma.subscript}.
\end{note}

\rSec1[expr.const]{Constant expressions}%
\indextext{expression!constant}

Expand Down
18 changes: 18 additions & 0 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@
\end{codeblock}
\end{example}

\rSec1[depr.comma.subscript]{Comma operator in subscript expressions}

\pnum
A comma expression\iref{expr.comma}
appearing as the \grammarterm{expr-or-braced-init-list}
of a subscripting expression\iref{expr.sub} is deprecated.
\begin{note}
A parenthesized comma expression is not deprecated.
\end{note}
\begin{example}
\begin{codeblock}
void f(int *a, int b, int c) {
a[b,c]; // deprecated
a[(b,c)]; // OK
}
\end{codeblock}
\end{example}

\rSec1[depr.array.comp]{Array comparisons}

\pnum
Expand Down