[Bug libstdc++/86590] Codegen is poor when passing std::string by value with _GLIBCXX_EXTERN_TEMPLATE undefined
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jul 20 09:25:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86590
--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #15)
> (In reply to Jonathan Wakely from comment #14)
> > That's been asked for repeatedly but will never happen, instead this is
> > being added to C++2a:
> > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0595r1.html
> >
> > So we'd do
> >
> > static _GLIBCXX17_CONSTEXPR size_t
> > length(const char_type* __s)
> > {
> > #if __cplusplus >= 201703L
> > if (std::is_constant_evaluated())
>
> Hmm, std::is_constant_evaluated would only be declared for C++2a, so we'd
> need to use the magic builtin directly here, not the std:: wrapper.
So, what is the status of P0595R1, has it been voted into C++2a already, or
will likely be voted in, something else?
I can certainly implement __builtin_is_constant_evaluated .
More information about the Gcc-bugs
mailing list