Skip to content

Commit 4f163f4

Browse files
authored
Merge 2019-07 CWG Motion 19
P1152R4 Deprecating volatile Fixes #2999.
2 parents 87f577e + 274108e commit 4f163f4

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

source/declarations.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3350,6 +3350,8 @@
33503350
\indextext{parameter!\idxcode{void}}%
33513351
Except for this special case, a parameter shall not have type \term{cv}
33523352
\tcode{void}.
3353+
A parameter with \tcode{volatile}-qualified type is deprecated;
3354+
see~\ref{depr.volatile.type}.
33533355
If the
33543356
\grammarterm{parameter-declaration-clause}
33553357
\indextext{argument type!unknown}%
@@ -3509,6 +3511,10 @@
35093511
There shall be no arrays of functions, although there can be arrays of pointers
35103512
to functions.
35113513

3514+
\pnum
3515+
A \tcode{volatile}-qualified return type is deprecated;
3516+
see~\ref{depr.volatile.type}.
3517+
35123518
\pnum
35133519
Types shall not be defined in return or parameter types.
35143520

@@ -6521,6 +6527,8 @@
65216527
the \grammarterm{decl-specifier-seq} and
65226528
\placeholder{S} consist of the \grammarterm{storage-class-specifier}{s} of
65236529
the \grammarterm{decl-specifier-seq} (if any).
6530+
A \cv{} that includes \tcode{volatile} is deprecated;
6531+
see~\ref{depr.volatile.type}.
65246532
First, a variable with a unique name \exposid{e} is introduced. If the
65256533
\grammarterm{assignment-expression} in the \grammarterm{initializer}
65266534
has array type \tcode{A} and no \grammarterm{ref-qualifier} is present,

source/expressions.tex

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3309,8 +3309,10 @@
33093309
\end{note}
33103310
The operand shall be a modifiable lvalue. The type of the operand shall
33113311
be an arithmetic type other than \cv{}~\tcode{bool},
3312-
or a pointer to a complete object type. The value
3313-
of the operand object is modified by adding \tcode{1} to it.
3312+
or a pointer to a complete object type.
3313+
An operand with \tcode{volatile}-qualified type is deprecated;
3314+
see~\ref{depr.volatile.type}.
3315+
The value of the operand object is modified by adding \tcode{1} to it.
33143316
The
33153317
\indextext{value computation}%
33163318
value computation of the \tcode{++} expression is sequenced before the
@@ -4265,6 +4267,8 @@
42654267
The operand shall be a modifiable lvalue. The type of the operand shall
42664268
be an arithmetic type other than \cv{}~\tcode{bool},
42674269
or a pointer to a completely-defined object type.
4270+
An operand with \tcode{volatile}-qualified type is deprecated;
4271+
see~\ref{depr.volatile.type}.
42684272
The result is the updated operand; it is an lvalue, and it is a
42694273
bit-field if the operand is a bit-field.
42704274
The expression \tcode{++x} is equivalent to \tcode{x+=1}.
@@ -6690,10 +6694,20 @@
66906694
resulting value of the bit-field is
66916695
\impldefplain{value of bit-field that cannot represent!assigned value}.
66926696

6697+
\pnum
6698+
A simple assignment whose left operand is of
6699+
a \tcode{volatile}-qualified non-class type
6700+
is deprecated\iref{depr.volatile.type}
6701+
unless the assignment is either a discarded-value expression or
6702+
appears in an unevaluated context.
6703+
66936704
\pnum
66946705
The behavior of an expression of the form \tcode{E1 \placeholder{op}= E2}
66956706
is equivalent to \tcode{E1 = E1 \placeholder{op} E2} except
6696-
that \tcode{E1} is evaluated only once. In \tcode{+=} and \tcode{-=},
6707+
that \tcode{E1} is evaluated only once.
6708+
Such expressions are deprecated
6709+
if \tcode{E1} has \tcode{volatile}-qualified type; see~\ref{depr.volatile.type}.
6710+
In \tcode{+=} and \tcode{-=},
66976711
\tcode{E1} shall either have arithmetic type or be a pointer to a
66986712
possibly cv-qualified completely-defined object type. In all other
66996713
cases, \tcode{E1} shall have arithmetic type.

source/future.tex

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,27 @@
9191
\end{codeblock}
9292
\end{example}
9393

94+
\rSec1[depr.volatile.type]{Deprecated \tcode{volatile} types}
95+
96+
\pnum
97+
Postfix \tcode{++} and \tcode{\dcr} expressions\iref{expr.post.incr} and
98+
prefix \tcode{++} and \tcode{\dcr} expressions\iref{expr.pre.incr}
99+
of \tcode{volatile}-qualified arithmetic and pointer types are deprecated.
100+
101+
\pnum
102+
Certain assignments
103+
where the left operand is a \tcode{volatile}-qualified non-class type
104+
are deprecated; see~\ref{expr.ass}.
105+
106+
\pnum
107+
A function type\iref{dcl.fct}
108+
with a parameter with \tcode{volatile}-qualified type or
109+
with a \tcode{volatile}-qualified return type is deprecated.
110+
111+
\pnum
112+
A structured binding\iref{dcl.struct.bind} of a \tcode{volatile}-qualified type
113+
is deprecated.
114+
94115
\rSec1[depr.static.constexpr]{Redeclaration of \tcode{static constexpr} data members}
95116

96117
\pnum

0 commit comments

Comments
 (0)