diff options
author | David Blaikie <dblaikie@gmail.com> | 2021-07-08 13:30:14 -0700 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2021-07-08 13:37:57 -0700 |
commit | 1def2579e10dd84405465f403e8c31acebff0c97 (patch) | |
tree | 8f8965df36c9eadb466cccd78d1a384ebd550cc5 /llvm/lib/Support/VirtualFileSystem.cpp | |
parent | a7992b43a54f89dca7b76cb79d1045acce6dbe1f (diff) | |
download | llvm-1def2579e10dd84405465f403e8c31acebff0c97.zip llvm-1def2579e10dd84405465f403e8c31acebff0c97.tar.gz llvm-1def2579e10dd84405465f403e8c31acebff0c97.tar.bz2 |
PR51018: Remove explicit conversions from SmallString to StringRef to future-proof against C++23
C++23 will make these conversions ambiguous - so fix them to make the
codebase forward-compatible with C++23 (& a follow-up change I've made
will make this ambiguous/invalid even in <C++23 so we don't regress
this & it generally improves the code anyway)
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
-rw-r--r-- | llvm/lib/Support/VirtualFileSystem.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index 3f6c434..15bb54e 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -1604,7 +1604,7 @@ private: } // Remove trailing slash(es), being careful not to remove the root path - StringRef Trimmed(Name); + StringRef Trimmed = Name; size_t RootPathLen = sys::path::root_path(Trimmed, path_style).size(); while (Trimmed.size() > RootPathLen && sys::path::is_separator(Trimmed.back(), path_style)) |