[Bug c++/80265] __builtin_{memcmp,memchr,strlen} are not usable in constexpr functions

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 11 20:56:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80265

--- Comment #15 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Pedro Alves from comment #6)
> Hmm.  I'd argue that __builtin_constant_p (s) should return true in that case,
> since we're in a constexpr?

No, the compiler is right; the address of the local array variable is not
constant, only its contents.


More information about the Gcc-bugs mailing list