https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103297
--- Comment #1 from cqwrteur <unlvsur at live dot com> --- Another issue #include<string_view> #include<string> #include<cassert> inline constexpr std::string_view lifetime_detector(std::string const& str) noexcept { return str; } inline constexpr bool test2(std::string_view vw2) noexcept { bool res{true}; for(auto e : vw2) res|=e; return true; } inline constexpr bool test() noexcept { std::string_view vw{lifetime_detector("abcde12124")}; return test2(vw); } static_assert(test()); int main() { assert(test()); } This does not get detected at neither compile nor runtime???