diff options
| author | Hans Wennborg <hans@chromium.org> | 2020-02-03 16:56:15 +0100 |
|---|---|---|
| committer | Hans Wennborg <hans@chromium.org> | 2020-02-03 16:59:37 +0100 |
| commit | 4ea9a4aba4a7cfea0325022d50b97a9409026ab5 (patch) | |
| tree | 128995f3695d3d29e02d8223d47b0c93087894c3 /llvm/include | |
| parent | 7ad47b46b55fe33bc763411ae7b8bcca5a63d8dc (diff) | |
| download | bcm5719-llvm-4ea9a4aba4a7cfea0325022d50b97a9409026ab5.tar.gz bcm5719-llvm-4ea9a4aba4a7cfea0325022d50b97a9409026ab5.zip | |
Declare __builtin_strlen in StringRef.h as constexpr
Otherwise Visual Studio 2017 will complain about
llvm::StringRef::strlen not being constexpr:
StringRef.h(80): error C3615: constexpr function 'llvm::StringRef::strLen' cannot result in a constant expression
StringRef.h(84): note: failure was caused by call of undefined function or one not declared 'constexpr'
(cherry picked from commit b3d7d1061dc375bb5ea725e6597382fcd37f41d6)
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/ADT/StringRef.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h index 9bfaaccd953..6d75cf8b04e 100644 --- a/llvm/include/llvm/ADT/StringRef.h +++ b/llvm/include/llvm/ADT/StringRef.h @@ -24,7 +24,7 @@ // Declare the __builtin_strlen intrinsic for MSVC so it can be used in // constexpr context. #if defined(_MSC_VER) -extern "C" size_t __builtin_strlen(const char *); +extern "C" constexpr size_t __builtin_strlen(const char *); #endif namespace llvm { |

