public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Remove more redundant union members
Date: Wed,  2 Nov 2022 20:33:32 +0000	[thread overview]
Message-ID: <20221102203332.672558-1-jwakely@redhat.com> (raw)

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


                 reply	other threads:[~2022-11-02 20:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221102203332.672558-1-jwakely@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).