Explorar o código

cmMakefile: Fix compilation on EDG-based compilers such as LCC

Compilers based on EDG frontend sometimes throw
an internal error while using `this->` at some
circumstances. While it is up to be fixed in future
versions of front end, this bug still occurs in
some modern compilers, such as LCC for Elbrus CPUs,
and probably others (maybe ICC). It caused CMake to be
unbuildable by these compilers. This patch fixes it.
makise-homura %!s(int64=4) %!d(string=hai) anos
pai
achega
d6746fd05c
Modificáronse 1 ficheiros con 4 adicións e 5 borrados
  1. 4 5
      Source/cmMakefile.cxx

+ 4 - 5
Source/cmMakefile.cxx

@@ -3982,11 +3982,10 @@ cmValue cmMakefile::GetProperty(const std::string& prop) const
   if (prop == "TESTS") {
     std::vector<std::string> keys;
     // get list of keys
-    std::transform(this->Tests.begin(), this->Tests.end(),
-                   std::back_inserter(keys),
-                   [](decltype(this->Tests)::value_type const& pair) {
-                     return pair.first;
-                   });
+    const auto* t = this;
+    std::transform(
+      t->Tests.begin(), t->Tests.end(), std::back_inserter(keys),
+      [](decltype(t->Tests)::value_type const& pair) { return pair.first; });
     output = cmJoin(keys, ";");
     return cmValue(output);
   }