This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Deprecating arithmetic on std::atomic<void*>

I know it's a bit late, but I'd like to propose deprecating the
libstdc++ extension that allows arithmetic on std::atomic<void*>.
Currently we make it behave like arithmetic on void*, which is also a
GNU extension (
We also allow arithmetic on types such as std::atomic<void(*)()> which
is probably not useful (PR 69769).

C++11 and C++14 were silent on the matter, but C++17 makes it
explicitly ill-formed (see page 2). I'm
implementing that for C++17 mode but would like it to be ill-formed
for all modes in a future release.

So I'd like to apply this patch to the gcc-7/changes.html page:

--- htdocs/gcc-7/changes.html 17 Apr 2017 22:12:35 -0000 1.77 +++ htdocs/gcc-7/changes.html 19 Apr 2017 17:05:27 -0000 @@ -38,6 +38,10 @@

  <li>The Cilk+ extensions to the C and C++ languages have been deprecated.</li>
+  <li>The extension allowing arithmetic on <code>std::atomic&lt;void*&gt;</code>
+      and types like <code>std::atomic&lt;R(*)()&gt;</code>
+      has been deprecated.</li>

<!-- .................................................................. -->

Does this seem reasonable, or do people think we need to keep this
feature, to match the core language extensions?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]