diff --git a/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h b/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h index 4ff84a0a7b3..c179c9599ee 100644 --- a/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h +++ b/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h @@ -57,9 +57,8 @@ Utils::PathString fromNativePath(const llvm::SmallString<256> &string) { Utils::PathString path(string.data(), string.size()); -#ifdef _WIN32 - std::replace(path.begin(), path.end(), '\\', '/'); -#endif + if (Utils::HostOsInfo::isWindowsHost()) + std::replace(path.begin(), path.end(), '\\', '/'); return path; }