Skip to content

Commit

Permalink
Fix taking reference of temporary variable
Browse files Browse the repository at this point in the history
  • Loading branch information
tuokri committed Sep 4, 2024
1 parent 68decfa commit 68a5c17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ void clang_format(const std::vector<fs::path>& paths)
for (const auto& path: paths)
{
const auto style_arg = std::format("--style=file:{}", cf_cfg_file.string());
const auto& pstr = fs::canonical(path).string();
const auto path_canonical = fs::canonical(path);
const auto& pstr = path_canonical.string();
std::cout << std::format("running clang-format on '{}'\n", pstr);
bp::execute(bp::process(ctx, cf_prog, {pstr, style_arg, "-i", "--Werror"}));
// TODO: check exit code and throw on clang_format failure?
Expand Down

0 comments on commit 68a5c17

Please sign in to comment.