error: no type named 'string_view' in namespace 'std'
Question
cat buggy-code.cpp
#include <iostream>
#include <string>
#include <string_view>
int main() {
std::string s = "Hellooooooooooooooo ";
std::string_view sv = s + "World\n";
std::cout << sv;
}
clang++ -fsanitize=scudo -g buggy-code.cpp
buggy-code.cpp:7:8: error: no type named 'string_view' in namespace 'std'
std::string_view sv = s + "World\n";
~~~~~^
1 error generated.
Answer
clang++ -std=c++17 -fsanitize=scudo -g buggy-code.cpp