From 8761c5fd86851b9bb23717de2301feee0b8e4b57 Mon Sep 17 00:00:00 2001 From: Axel Naumann <Axel.Naumann@cern.ch> Date: Fri, 11 Aug 2017 08:39:10 +0200 Subject: [PATCH] Do not use to_string to find experimental::string_view. It was removed for std::string_view, and we do not need to test for it specifically. --- cmake/modules/RootConfiguration.cmake | 2 +- configure | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index 97961518141..cb26f0f15d5 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -517,7 +517,7 @@ else() endif() CHECK_CXX_SOURCE_COMPILES("#include <experimental/string_view> - int main() { std::experimental::string_view().to_string(); return 0;}" found_stdexpstringview) + int main() { char arr[3] = {'B', 'a', 'r'}; std::experimental::string_view strv(arr, sizeof(arr)); return 0;}" found_stdexpstringview) if(found_stdexpstringview) set(hasstdexpstringview define) else() diff --git a/configure b/configure index 69c84c57005..5012b904418 100755 --- a/configure +++ b/configure @@ -2841,7 +2841,7 @@ hasstodstringview="undef" message "Checking for string_view implementation" if test "x$usecxx11" = "xdefine" ; then check_code '#include <string_view> -int main() {std::string_view().to_string(); return 0; }' '$(CXX11FLAGS)' +int main() { char arr[3] = {'B', 'a', 'r'}; std::string_view strv(arr, sizeof(arr)); return 0;}" }' '$(CXX11FLAGS)' if test $include_result -eq 1 ; then hasstdstringview="define" result '<string_view>' @@ -2852,7 +2852,7 @@ int main() { size_t pos; std::string_view str; std::stod(str,&pos); return 0;}' fi else check_code '#include <experimental/string_view> -int main() {std::experimental::string_view().to_string(); return 0; }' '$(CXX11FLAGS)' +int main() { char arr[3] = {'B', 'a', 'r'}; std::experimental::string_view strv(arr, sizeof(arr)); return 0;}"' '$(CXX11FLAGS)' if test $include_result -eq 1 ; then hasstdexpstringview="define" result '<experimental/string_view>' -- GitLab