Fix a broken build for gcc <= 7.1
authorHaojian Wu <hokein.wu@gmail.com>
Wed, 14 Oct 2020 13:13:13 +0000 (15:13 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 14 Oct 2020 13:14:59 +0000 (15:14 +0200)
we need add a "this->" inside the lambda body to workaround it. Rewrite
it to normal for-range loop.

clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp

index 82ef26e..886c8ee 100644 (file)
@@ -27,7 +27,6 @@
 #include "clang/Tooling/Refactoring.h"
 #include "clang/Tooling/Refactoring/Rename/USRFinder.h"
 #include "clang/Tooling/Tooling.h"
-#include "llvm/ADT/STLExtras.h"
 
 #include <algorithm>
 #include <set>
@@ -115,8 +114,8 @@ private:
       addUSRsOfCtorDtors(Specialization);
     SmallVector<ClassTemplatePartialSpecializationDecl *, 4> PartialSpecs;
     TemplateDecl->getPartialSpecializations(PartialSpecs);
-    llvm::for_each(PartialSpecs,
-                   [&](const auto *Spec) { addUSRsOfCtorDtors(Spec); });
+    for (const auto *Spec : PartialSpecs)
+      addUSRsOfCtorDtors(Spec);
     addUSRsOfCtorDtors(TemplateDecl->getTemplatedDecl());
   }