public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nikolas Klauser <nikolasklauser@berlin.de>
To: Jason Merrill <jason@redhat.com>
Cc: gcc@gcc.gnu.org, Louis Dionne <ldionne.2@gmail.com>,
	Mark de Wever <koraq@xs4all.nl>,
	aaron@aaronballman.com, libstdc++ <libstdc++@gcc.gnu.org>
Subject: Re: GCC support for extensions from later standards
Date: Mon, 7 Aug 2023 20:03:05 -0700	[thread overview]
Message-ID: <19c14d57-574b-9b31-de5a-a0590e189ce6@berlin.de> (raw)
In-Reply-To: <CADzB+2mGjdH6xDnJq+So4h2+56SQsNjFDmRVid9dCZ0evieE-g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2453 bytes --]


On 06.08.23 12:19, Jason Merrill wrote:
> On Wed, Aug 2, 2023 at 12:02 PM Nikolas Klauser 
> <nikolasklauser@berlin.de> wrote:
>
>     Hi everyone!
>
>     I'm working on libc++ and we are currently discussing using
>     language extensions from later standards
>     (https://discourse.llvm.org/t/rfc-use-language-extensions-from-future-standards-in-libc/71898/4).
>     By that I mean things like using `if constexpr` with `-std=c++11`.
>     GCC has quite a lot of these kinds of conforming extensions, but
>     doesn't document them AFAICT. While discussing using these
>     extensions, the question came up what GCCs support policy for
>     these is. Aaron was kind enough to answer these questions for us
>     on the Clang side. Since I couldn't find anything in the
>     documentation, I thought I'd ask here.
>
>     So, here are my questions:
>
>     Do you expect that these extensions will ever be removed for some
>     reason? If yes, what could those reasons be?
>
>
> Potentially, if they don't actually work properly in earlier standard 
> modes.  I recently noticed that while we allow DMI and =default in 
> C++03 mode with a pedwarn, combining them doesn't work.
>
> Some of the extensions are needed by libstdc++ and are therefore well 
> tested; these are extremely unlikely to ever be removed.  libstdc++ 
> folks, is there a list of these?
>
>     Would you be interested in documenting them?
>
>
> That would be useful, yes.
>
> There is a patch in review to add __has_feature/__has_extension to 
> G++, which would seem like a suitable context for this documentation.
>
>     Aaron noted that we should ask the Clang folks before using them,
>     so they can evaluated whether the extension makes sense, since
>     they might not be aware of them, and some might be broken. So I'd
>     be interested whether you would also like us to ask whether you
>     want to actually support these extensions.
>
>
> Sounds good.
>
> Jason

Thanks for the answers!

There are a few really interesting extensions that I would like to use:

- inline variables
- variable templates
- `if constexpr`
- fold expressions
- conditional explicit
- static operator()

(https://godbolt.org/z/5n9Y4h69n)

Is anybody aware of any problems with these extensions? I'd be happy to 
provide a patch to add these extensions to the documentation, but I 
couldn't figure out how to build the documentation without building all 
of gcc.

Nikolas

  parent reply	other threads:[~2023-08-08  3:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3A4C9996-750B-4E3F-8F30-E3DA4366C7B5@berlin.de>
2023-08-06 19:19 ` Jason Merrill
2023-08-06 19:43   ` Jonathan Wakely
2023-08-07 13:04     ` Jonathan Wakely
2023-08-08  8:55       ` Jonathan Wakely
2023-08-08  3:03   ` Nikolas Klauser [this message]
2023-08-08  7:33     ` Jakub Jelinek
2023-08-08 16:03       ` Nikolas Klauser
2023-08-08 16:07         ` Jonathan Wakely
2023-08-08 16:10           ` Jonathan Wakely
2023-08-08 16:33             ` Nikolas Klauser

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=19c14d57-574b-9b31-de5a-a0590e189ce6@berlin.de \
    --to=nikolasklauser@berlin.de \
    --cc=aaron@aaronballman.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=koraq@xs4all.nl \
    --cc=ldionne.2@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).