On Sun, 6 Aug 2023 at 20:20, Jason Merrill via Libstdc++
<libstd...@gcc.gnu.org> wrote:
>
> On Wed, Aug 2, 2023 at 12:02 PM Nikolas Klauser <nikolasklau...@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?

We use variadic templates and long long in C++98. We use a DMI in
__gnu_cxx::__mutex even in C++98. I don't think we unconditionally use
anything else, because we can't rely on it being available when using
non-GCC compilers, or when compiling with -Wsystem-headers -pedantic.
We don't use if-constexpr before C++17 for example.

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

Reply via email to