Re: GCC support for extensions from later standards

2023-08-08 Thread Nikolas Klauser
Yes, Clang allows it. Most importantly though: you don’t have to be in a constexpr function for `if constexpr` to be useful. e.g. the Algorithms aren’t constexpr until C++20, but a lot of them have overloads for improving the algorithm based on the iterator category. Having `if constexpr` there

Re: GCC support for extensions from later standards

2023-08-08 Thread Jonathan Wakely via Gcc
On Tue, 8 Aug 2023 at 17:07, Jonathan Wakely wrote: > > On Tue, 8 Aug 2023 at 17:04, Nikolas Klauser wrote: > > > > Luckily most of these aren’t problems for libc++. We only support the > > latest GCC. We can only use `if constexpr` in C++11, but that is already a > > win I think. > > Can you use

Re: GCC support for extensions from later standards

2023-08-08 Thread Jonathan Wakely via Gcc
On Tue, 8 Aug 2023 at 17:04, Nikolas Klauser wrote: > > Luckily most of these aren’t problems for libc++. We only support the latest > GCC. We can only use `if constexpr` in C++11, but that is already a win I > think. Can you use it in C++11 though? The body of a constexpr function must be a sin

Re: GCC support for extensions from later standards

2023-08-08 Thread Nikolas Klauser
Luckily most of these aren’t problems for libc++. We only support the latest GCC. We can only use `if constexpr` in C++11, but that is already a win I think. Nikolas > On Aug 8, 2023, at 12:33 AM, Jakub Jelinek wrote: > > On Mon, Aug 07, 2023 at 08:03:05PM -0700, Nikolas Klauser wrote: >> Than

Re: GCC support for extensions from later standards

2023-08-08 Thread Jonathan Wakely via Gcc
On Mon, 7 Aug 2023 at 14:04, Jonathan Wakely wrote: > > On Sun, 6 Aug 2023 at 20:43, Jonathan Wakely wrote: > > > > On Sun, 6 Aug 2023 at 20:20, Jason Merrill via Libstdc++ > > wrote: > > > > > > On Wed, Aug 2, 2023 at 12:02 PM Nikolas Klauser > > > wrote: > > > > > > > Hi everyone! > > > > > >

Re: GCC support for extensions from later standards

2023-08-08 Thread Jakub Jelinek via Gcc
On Mon, Aug 07, 2023 at 08:03:05PM -0700, Nikolas Klauser wrote: > 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

Re: GCC support for extensions from later standards

2023-08-07 Thread Nikolas Klauser
On 06.08.23 12:19, Jason Merrill wrote: On Wed, Aug 2, 2023 at 12:02 PM Nikolas Klauser 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-fu

Re: GCC support for extensions from later standards

2023-08-07 Thread Jonathan Wakely via Gcc
On Sun, 6 Aug 2023 at 20:43, Jonathan Wakely wrote: > > On Sun, 6 Aug 2023 at 20:20, Jason Merrill via Libstdc++ > wrote: > > > > On Wed, Aug 2, 2023 at 12:02 PM Nikolas Klauser > > wrote: > > > > > Hi everyone! > > > > > > I'm working on libc++ and we are currently discussing using language > >

Re: GCC support for extensions from later standards

2023-08-06 Thread Jonathan Wakely via Gcc
On Sun, 6 Aug 2023 at 20:20, Jason Merrill via Libstdc++ wrote: > > On Wed, Aug 2, 2023 at 12:02 PM Nikolas Klauser > 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-u

Re: GCC support for extensions from later standards

2023-08-06 Thread Jason Merrill via Gcc
On Wed, Aug 2, 2023 at 12:02 PM Nikolas Klauser 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 th

GCC support for extensions from later standards

2023-08-02 Thread Nikolas Klauser
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