This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Implement C++20 constexpr <algorithm>, , and <array>
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Ed Smith-Rowland <3dw4rd at verizon dot net>, Jonathan Wakely <jwakely at redhat dot com>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 29 Mar 2019 16:12:17 +0100
- Subject: Re: Implement C++20 constexpr <algorithm>, , and <array>
- References: <5bc52349-02c1-8848-b67a-d944c01b95c9@verizon.net> <20190318221826.GH943@redhat.com> <57626d82-ca37-b818-6216-95fab44d8cd1@verizon.net> <CADzB+2nxvheNTFtWDZtVchpf_+u6tQB=opJrFpNHHBvjW7w9bQ@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Mar 29, 2019 at 11:07:53AM -0400, Jason Merrill wrote:
> On Tue, Mar 19, 2019 at 4:57 PM Ed Smith-Rowland via gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > On 3/18/19 6:18 PM, Jonathan Wakely wrote:
> > > On 17/03/19 22:54 -0400, Ed Smith-Rowland via libstdc++ wrote:
> > > I'm very surprised that none of the algos that dispatch to
> > > __builtin_memove need changes, because those optimizations won't work
> > > in constant expressions. I would expect to have to use
> > > std::is_constant_evaluated to disable the optimizations when used in
> > > constant expressions.
> > >
> > As am I. As I mentioned on IRC I could roll a constexpr memmove.
> >
> > I was wondering if somehow I'm not checking what I think I'm checking
> > (but I don't see how.)
> >
> > I wonder if the builtins are handled differently somehow by the front
> > end. I'm still not sure why __builtin_memcmp is OK for array == array
> > but not array != array. In that case I just do element by element
> > compare for constexpr now anyway.
>
> Is there a PR about making these builtins work in constexpr?
Yes, PR80265.
Jakub