I'm trying to construct a vector
of string_view
s from an initializer_list< const char * >
which worked okay on GCC 9, but after updating to GCC 10 it crashes during runtime.
#include <vector>
#include <string_view>
#include <cstdio>
int main()
{
std::vector< std::string_view > const v { { "Before.", "Afterrrrrr." } };
printf( "%s %zu\n", v[0].data(), v[0].length() );
printf( "%s %zu\n", v[1].data(), v[1].length() );
return 0;
}
Clang also handles the code okay, what gives?