This is the mail archive of the
mailing list for the GCC project.
Deprecating arithmetic on std::atomic<void*>
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Wed, 19 Apr 2017 18:07:36 +0100
- Subject: Deprecating arithmetic on std::atomic<void*>
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jwakely at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 87790DDB24
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 87790DDB24
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 (https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html).
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 https://wg21.link/p0558r1 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<void*></code>
+ and types like <code>std::atomic<R(*)()></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?