public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Deprecating arithmetic on std::atomic<void*>
@ 2017-04-19 17:07 Jonathan Wakely
  2017-04-19 17:43 ` Ville Voutilainen
  2017-04-20  6:19 ` Florian Weimer
  0 siblings, 2 replies; 24+ messages in thread
From: Jonathan Wakely @ 2017-04-19 17:07 UTC (permalink / raw)
  To: gcc, libstdc++

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>
 
   <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>
 </ul>
 
 <!-- .................................................................. -->


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

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2017-04-20 12:20 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19 17:07 Deprecating arithmetic on std::atomic<void*> Jonathan Wakely
2017-04-19 17:43 ` Ville Voutilainen
2017-04-20  6:19 ` Florian Weimer
2017-04-20  9:18   ` Jonathan Wakely
2017-04-20  9:21     ` Jakub Jelinek
2017-04-20  9:25       ` Jonathan Wakely
2017-04-20  9:30         ` Jakub Jelinek
2017-04-20  9:30         ` Jonathan Wakely
2017-04-20  9:43         ` Florian Weimer
2017-04-20  9:52           ` Jonathan Wakely
2017-04-20  9:57             ` Florian Weimer
2017-04-20 10:03               ` Jonathan Wakely
2017-04-20 10:07                 ` Jakub Jelinek
2017-04-20 10:12                   ` Jonathan Wakely
2017-04-20 11:20                     ` Jonathan Wakely
2017-04-20 12:20                       ` Jonathan Wakely
2017-04-20  9:22     ` Jonathan Wakely
2017-04-20  9:25       ` Florian Weimer
2017-04-20  9:31         ` Jonathan Wakely
2017-04-20  9:39           ` Jonathan Wakely
2017-04-20  9:49             ` Florian Weimer
2017-04-20  9:53               ` Jonathan Wakely
2017-04-20 11:29             ` Pedro Alves
2017-04-20  9:31   ` Marc Glisse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).