[PATCH] D76997: Fix StringRef::strLen in windows with clang++ C++17
Aaron Ballman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 5 17:17:23 PDT 2020
aaron.ballman added inline comments.
================
Comment at: llvm/include/llvm/ADT/StringRef.h:84
return __builtin_strlen(Str);
+#elif __cplusplus > 201402L && !defined(_MSC_VER)
+ return std::char_traits<char>::length(Str);
----------------
I still think the addition of `!defined(_MSC_VER)` is incorrect and that LLVM's CMake needs to be updated to pass `/Zc:__cplusplus` to MSVC.
However, I think there's a different change to make possibly. We require MSVC 2017 with the latest updates installed (https://llvm.org/docs/GettingStartedVS.html#software), but `_MSC_VER == 1916` is 2017 Update 9 (Visual Studio 2017 version 15.9.11). I currently have Visual Studio 2017 version 15.9.22 installed, so it seems like the version check for the builtin branch can turn into `defined(_MSC_VER)` and the changes to the STL branch can be removed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76997/new/
https://reviews.llvm.org/D76997
More information about the llvm-commits
mailing list