]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around an internal compiler error on GCC7. 6515/head
authorDavid Wells <wellsd2@rpi.edu>
Mon, 7 May 2018 23:14:22 +0000 (19:14 -0400)
committerMatthias Maier <tamiko@43-1.org>
Tue, 8 May 2018 04:36:48 +0000 (23:36 -0500)
source/gmsh/utilities.cc

index 8e011edc130eb22205100090b100feb7a5b5e287..d4be45f358631b9a9f3143a20779ad8b0a4cb945 100644 (file)
@@ -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<const std::string *, 5> 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)));

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.