https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91901
--- Comment #2 from Trass3r <trass3r at gmail dot com> --- (In reply to Richard Biener from comment #1) > The compiler doesn't know that printf doesn't modify the data you pass it to > so it cannot elide the automatic variable. Does it matter in this case? The data comes from constexpr arrays. constexpr auto names = strings<E>(range_v<E>); // aka const std::array<std::string_view, 257> return names[i]; And the name_v strings are deduced as const static_string<3>.