https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71537
--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> --- Unfortunately, __builtin_memchr is not usable in constexpr contexts. Hardly any of these builtins are. I think the only exception is __builtin_strlen but only to a limited extent (bug 77357 has some background). There's a general problem with folding it and other functions like it when the argument is an array (i.e., a CONSTRUCTOR in GCC, as opposed to a STRING_CST). Bug 78257 has a test case involving memcmp but the same problem applies to memchr. Once that is solved all of this should just work both in C and in C++ (i.e., even beyond constexpr).
