https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94933
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:22b6b5d6cfb76deb68ca5bc0bcae8b4245df946d commit r11-30-g22b6b5d6cfb76deb68ca5bc0bcae8b4245df946d Author: Jonathan Wakely <jwak...@redhat.com> Date: Sun May 3 12:46:15 2020 +0100 libstdc++: Make byte-sized std::fill_n a constant expression (PR 94933) The overload for byte types uses memset and isn't constexpr. This adds the specifier and uses std::is_constant_evaluated() to provide a compile-time alternative. PR libstdc++/94933 * include/bits/stl_algobase.h (__fill_a1): Make overload for byte types usable in constant expressions. * testsuite/25_algorithms/fill_n/constexpr.cc: Test with bytes and non-scalars.