Fixed unit tests on MSVC

This commit is contained in:
Bartek Kryza
2023-02-07 22:18:57 +01:00
parent 865ae9d8ed
commit 43328e3e2d
3 changed files with 20 additions and 3 deletions

View File

@@ -1135,9 +1135,14 @@ void translation_unit_visitor::ensure_lambda_type_is_relative(
#ifdef _MSC_VER
auto root_name = fmt::format(
"{}\\", std::filesystem::current_path().root_name().string());
if(root_name.back() == '\\') {
root_name.pop_back();
root_name.push_back('/');
}
#else
auto root_name = std::string{"/"};
#endif
std::string lambda_prefix{fmt::format("(lambda at {}", root_name)};
while (parameter_type.find(lambda_prefix) != std::string::npos) {