public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Remove more redundant union members
@ 2022-11-02 20:33 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2022-11-02 20:33 UTC (permalink / raw)
  To: libstdc++, gcc-patches

Tested powerpc64le-linux. Pushed to trunk.

-- >8 --

We don't need these 'unused' members because they're never used, and a
union with a single variant member is fine.

libstdc++-v3/ChangeLog:

	* libsupc++/eh_globals.cc (constant_init::unused): Remove.
	* src/c++11/system_error.cc (constant_init::unused): Remove.
	* src/c++17/memory_resource.cc (constant_init::unused): Remove.
---
 libstdc++-v3/libsupc++/eh_globals.cc      | 1 -
 libstdc++-v3/src/c++11/system_error.cc    | 1 -
 libstdc++-v3/src/c++17/memory_resource.cc | 1 -
 3 files changed, 3 deletions(-)

diff --git a/libstdc++-v3/libsupc++/eh_globals.cc b/libstdc++-v3/libsupc++/eh_globals.cc
index 0aadb692a96..12abfc10521 100644
--- a/libstdc++-v3/libsupc++/eh_globals.cc
+++ b/libstdc++-v3/libsupc++/eh_globals.cc
@@ -73,7 +73,6 @@ namespace
   struct constant_init
   {
     union {
-      unsigned char unused;
       __cxa_eh_globals obj;
     };
     constexpr constant_init() : obj() { }
diff --git a/libstdc++-v3/src/c++11/system_error.cc b/libstdc++-v3/src/c++11/system_error.cc
index 8c13642408d..5707e6b61d6 100644
--- a/libstdc++-v3/src/c++11/system_error.cc
+++ b/libstdc++-v3/src/c++11/system_error.cc
@@ -49,7 +49,6 @@ namespace
     struct constant_init
     {
       union {
-	unsigned char unused;
 	T obj;
       };
       constexpr constant_init() : obj() { }
diff --git a/libstdc++-v3/src/c++17/memory_resource.cc b/libstdc++-v3/src/c++17/memory_resource.cc
index 8bc55a69f1f..651d07489aa 100644
--- a/libstdc++-v3/src/c++17/memory_resource.cc
+++ b/libstdc++-v3/src/c++17/memory_resource.cc
@@ -82,7 +82,6 @@ namespace pmr
       struct constant_init
       {
 	union {
-	  unsigned char unused;
 	  T obj;
 	};
 	constexpr constant_init() : obj() { }
-- 
2.38.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-02 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 20:33 [committed] libstdc++: Remove more redundant union members Jonathan Wakely

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).