public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-7195] libstdc++: Fix versioned namespace build
Date: Thu, 11 Feb 2021 17:28:30 +0000 (GMT)	[thread overview]
Message-ID: <20210211172830.E5118383E82B@sourceware.org> (raw)

https://gcc.gnu.org/g:bc0f7db7ebb649fc4c290cb7327fba5c17d4ed28

commit r11-7195-gbc0f7db7ebb649fc4c290cb7327fba5c17d4ed28
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Feb 11 16:18:19 2021 +0000

    libstdc++: Fix versioned namespace build
    
    The recent changes to define various std::exception_ptr functions inline
    included a change so that the definitions of those functions would be
    omitted for the ABI unstable gnu-versioned-namespace configuration. That
    change was incorrect, because the existing functions that are gated by
    the _GLIBCXX_EH_PTR_COMPAT macro are always needed even for the
    versioned namespace.
    
    This change introduces a new macro to control whether operator== is
    defined as deleted or not, distinct from the existing macro. The new
    macro is not defined for versioned namespace builds, but the old macro
    still is.
    
    libstdc++-v3/ChangeLog:
    
            * libsupc++/eh_ptr.cc (_GLIBCXX_EH_PTR_RELOPS_COMPAT): Define
            new macro.
            * libsupc++/exception_ptr.h (_GLIBCXX_EH_PTR_USED): Check new
            macro instead of _GLIBCXX_EH_PTR_COMPAT.
            (operator==): Likewise.

Diff:
---
 libstdc++-v3/libsupc++/eh_ptr.cc       | 10 +++++++---
 libstdc++-v3/libsupc++/exception_ptr.h |  4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/libstdc++-v3/libsupc++/eh_ptr.cc b/libstdc++-v3/libsupc++/eh_ptr.cc
index 5d8ac1d879a..5c4685606fe 100644
--- a/libstdc++-v3/libsupc++/eh_ptr.cc
+++ b/libstdc++-v3/libsupc++/eh_ptr.cc
@@ -25,11 +25,15 @@
 #include <bits/c++config.h>
 #include "eh_atomics.h"
 
-#if ! _GLIBCXX_INLINE_VERSION
 // This macro causes exception_ptr to declare an older API (with corresponding
-// definitions in this file) and to mark some inline functions as "used" so
-// that definitions will be emitted in this translation unit.
+// definitions in this file).
 #define _GLIBCXX_EH_PTR_COMPAT
+
+#if ! _GLIBCXX_INLINE_VERSION
+// This macro causes some inline functions in exception_ptr to be marked
+// as "used" so that definitions will be emitted in this translation unit.
+// We need this because those functions were not inline in previous releases.
+#define _GLIBCXX_EH_PTR_RELOPS_COMPAT
 #endif
 
 #include <exception>
diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h
index 6d41b34fabe..9943668d9b3 100644
--- a/libstdc++-v3/libsupc++/exception_ptr.h
+++ b/libstdc++-v3/libsupc++/exception_ptr.h
@@ -39,7 +39,7 @@
 #include <typeinfo>
 #include <new>
 
-#ifdef _GLIBCXX_EH_PTR_COMPAT
+#ifdef _GLIBCXX_EH_PTR_RELOPS_COMPAT
 # define _GLIBCXX_EH_PTR_USED __attribute__((__used__))
 #else
 # define _GLIBCXX_EH_PTR_USED
@@ -153,7 +153,7 @@ namespace std
 #endif
 
 #if __cpp_impl_three_way_comparison >= 201907L \
-      && ! defined _GLIBCXX_EH_PTR_COMPAT
+      && ! defined _GLIBCXX_EH_PTR_RELOPS_COMPAT
       friend bool
       operator==(const exception_ptr&, const exception_ptr&) noexcept = default;
 #else


                 reply	other threads:[~2021-02-11 17:28 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=20210211172830.E5118383E82B@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).