From 390993fd2c27a8ab16d5220c7400420137b25335 Mon Sep 17 00:00:00 2001 From: David Wells Date: Mon, 7 May 2018 19:14:22 -0400 Subject: [PATCH] Work around an internal compiler error on GCC7. --- source/gmsh/utilities.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/gmsh/utilities.cc b/source/gmsh/utilities.cc index 8e011edc13..d4be45f358 100644 --- a/source/gmsh/utilities.cc +++ b/source/gmsh/utilities.cc @@ -100,11 +100,13 @@ namespace Gmsh if (base_name != prm.output_base_name) { - for (const auto &filename: {iges_file_name,geo_file_name,msh_file_name,log_file_name,warnings_file_name}) - { - const auto ret_value = std::remove(filename.c_str()); - AssertThrow(ret_value == 0, ExcMessage("Failed to remove "+filename)); - } + const std::array filenames + {{&iges_file_name, &geo_file_name, &msh_file_name, &log_file_name, &warnings_file_name}}; + for (const std::string *filename : filenames) + { + const auto ret_value = std::remove(filename->c_str()); + AssertThrow(ret_value == 0, ExcMessage("Failed to remove " + *filename)); + } const auto ret_value = std::remove(dir_template); AssertThrow(ret_value == 0, ExcMessage("Failed to remove "+std::string(dir_template))); -- 2.39.5