https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103879
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- clang rejects it also (with their libc++): <source>:10:5: error: variable of non-literal type 'S' cannot be defined in a constexpr function S s{"str"}; ^ <source>:6:29: note: 'S' is not literal because it has data member 'v' of non-literal type 'std::variant<std::string>' (aka 'variant<basic_string<char, char_traits<char>, allocator<char>>>') std::variant<std::string> v; ^