================
@@ -82,12 +82,14 @@ MockCompilationDatabase::getCompileCommand(PathRef File)
const {
FileName, std::move(CommandLine), "")};
}
-const char *testRoot() {
+std::string testRoot() {
+ llvm::SmallString<32> Path;
#ifdef _WIN32
- return "C:\\clangd-test";
+ llvm::sys::path::native("C:/clangd-test", Path);
#else
- return "/clangd-test";
+ llvm::sys::path::native("/clangd-test", Path);
#endif
+ return std::string(Path.str());
----------------
atetubou wrote:
`.str()` is redundant per
https://github.com/llvm/llvm-project/blob/56d31697c2a2c38844bdc0f43e537c29a5115d87/llvm/include/llvm/ADT/SmallString.h#L268?
```suggestion
return std::string(Path);
```
https://github.com/llvm/llvm-project/pull/179410
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits