public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: "libstdc++" <libstdc++@gcc.gnu.org>
Subject: RFC: Drop C++98 support for versioned namespace (i.e. unstable ABI mode)
Date: Sat, 28 Aug 2021 11:48:32 +0100	[thread overview]
Message-ID: <CAH6eHdTgHVV3u56isRPL=AVbZ1NbETuacFZCgOwCx+A-GGKHzg@mail.gmail.com> (raw)

Not something I plan to work on in the near future, but an idea worth sharing.

Before anybody panics, this does not affect the default configuration.
C++98 will still be supported. I'm only talking about the unstable ABI
build mode chosen when installing GCC, by
--enable-symvers=gnu-versioned-namespace. If you don't know what that
is, this RFC isn't something you need to worry about.

Currently there are some places where we can't define constructors,
assignment operators and destructors as defaulted, because it would
create an ABI incompatibility between C++98 (which can't use defaulted
members) and later standards.

That means that even for the unstable ABI (versioned namespace)
configuration, we are constrained by backwards compatibility (but
compat with older standards, not older GCC releases).

If we dropped C++98 support for the versioned namespace, it would open
up additional opportunities for improvements to the versioned
namespace mode.

As a specific example, std::allocator currently has a user-provided,
non-trivial default constructor. We can't define it as =default
because that doesn't work in C++98, and would make it trivial in
C++11, but still user-provided (and non-trivial) in C++98. We can't
make that change for the ABI stable mode anyway, because it would be
incompatible with older GCC releases. But we could do it for the
versioned namespace if we stopped supporting C++98.

             reply	other threads:[~2021-08-28 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-28 10:48 Jonathan Wakely [this message]
2021-08-28 11:24 ` Jonathan Wakely

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='CAH6eHdTgHVV3u56isRPL=AVbZ1NbETuacFZCgOwCx+A-GGKHzg@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --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).