This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for P1152R4: Deprecating some uses of volatile (PR c++/91361)
On Thu, Aug 29, 2019 at 03:14:36PM -0600, Martin Sebor wrote:
> On 8/28/19 5:56 PM, Marek Polacek wrote:
> > --- gcc/doc/invoke.texi
> > +++ gcc/doc/invoke.texi
> > @@ -3516,6 +3516,19 @@ result in a call to @code{terminate}.
> > Disable the warning about the case when a conversion function converts an
> > object to the same type, to a base class of that type, or to void; such
> > a conversion function will never be called.
> > +
> > +@item -Wvolatile @r{(C++ and Objective-C++ only)}
> > +@opindex Wvolatile
> > +@opindex Wno-volatile
> > +Warn about deprecated uses of the volatile qualifier. This includes postfix
> > +and prefix @code{++} and @code{--} expressions of volatile-qualified types,
> > +using simple assignments where the left operand is a volatile-qualified
> > +non-class type for their value, compound assignments where the left operand
> > +is a volatile-qualified non-class type, volatile-qualified function return
> > +type, volatile-qualified parameter type, and structured bindings of a
> > +volatile-qualified type. This usage was deprecated in C++20.
>
> Just a minor thing: Since the text uses volatile as a keyword
> (as opposed to an adjective) it should be @code{volatile},
> analogously how it's quoted in warnings.
Oh right, thanks. Fixed with:
2019-08-30 Marek Polacek <polacek@redhat.com>
* doc/invoke.texi (-Wvolatile): Use @code for volatile.
diff --git gcc/doc/invoke.texi gcc/doc/invoke.texi
index aa9886ee09f..44a8801e558 100644
--- gcc/doc/invoke.texi
+++ gcc/doc/invoke.texi
@@ -3520,13 +3520,14 @@ a conversion function will never be called.
@item -Wvolatile @r{(C++ and Objective-C++ only)}
@opindex Wvolatile
@opindex Wno-volatile
-Warn about deprecated uses of the volatile qualifier. This includes postfix
-and prefix @code{++} and @code{--} expressions of volatile-qualified types,
-using simple assignments where the left operand is a volatile-qualified
-non-class type for their value, compound assignments where the left operand
-is a volatile-qualified non-class type, volatile-qualified function return
-type, volatile-qualified parameter type, and structured bindings of a
-volatile-qualified type. This usage was deprecated in C++20.
+Warn about deprecated uses of the @code{volatile} qualifier. This includes
+postfix and prefix @code{++} and @code{--} expressions of
+@code{volatile}-qualified types, using simple assignments where the left
+operand is a @code{volatile}-qualified non-class type for their value,
+compound assignments where the left operand is a @code{volatile}-qualified
+non-class type, @code{volatile}-qualified function return type,
+@code{volatile}-qualified parameter type, and structured bindings of a
+@code{volatile}-qualified type. This usage was deprecated in C++20.
Enabled by default with @option{-std=c++2a}.
@end table