diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLib/run_compile_commands.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx index 0d692ca..b49803b 100644 --- a/Tests/CMakeLib/run_compile_commands.cxx +++ b/Tests/CMakeLib/run_compile_commands.cxx @@ -144,14 +144,11 @@ int main() cmsys::ifstream file("compile_commands.json"); CompileCommandParser parser(file); parser.Parse(); - for (CompileCommandParser::TranslationUnitsType::const_iterator - it = parser.GetTranslationUnits().begin(), - end = parser.GetTranslationUnits().end(); - it != end; ++it) { + for (auto const& tu : parser.GetTranslationUnits()) { std::vector<std::string> command; - cmSystemTools::ParseUnixCommandLine(it->at("command").c_str(), command); + cmSystemTools::ParseUnixCommandLine(tu.at("command").c_str(), command); if (!cmSystemTools::RunSingleCommand(command, nullptr, nullptr, nullptr, - it->at("directory").c_str())) { + tu.at("directory").c_str())) { std::cout << "ERROR: Failed to run command \"" << command[0] << "\"" << std::endl; exit(1); |