Author: Sven van Haastregt
Date: 2026-09-25T09:26:20+02:00
New Revision: 28cbb0f0a0c4cbf5e732fa74a362e451a648d26b

URL: 
https://github.com/llvm/llvm-project/commit/28cbb0f0a0c4cbf5e732fa74a362e451a648d26b
DIFF: 
https://github.com/llvm/llvm-project/commit/28cbb0f0a0c4cbf5e732fa74a362e451a648d26b.diff

LOG: [AST] Avoid deprecated implicit `this` capture for C++20; NFC (#226142)

`OpenMPClause.h` contains a lambda with an implicit `this` capture,
which triggers the C++20 deprecation warning in many compilation units
that (transitively) include this header.

Added: 
    

Modified: 
    clang/include/clang/AST/OpenMPClause.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/OpenMPClause.h 
b/clang/include/clang/AST/OpenMPClause.h
index 1b24442ea20fd..8238b81e991ae 100644
--- a/clang/include/clang/AST/OpenMPClause.h
+++ b/clang/include/clang/AST/OpenMPClause.h
@@ -9237,7 +9237,8 @@ class OMPInitClause final
     unsigned N = getNumPrefs();
     Expr *const *E = getTrailingObjects<Expr *>();
     ArrayRef<unsigned> Ends = getAttrEnds();
-    return llvm::map_range(llvm::seq<unsigned>(0, N), [=](unsigned I) {
+    return llvm::map_range(llvm::seq<unsigned>(0, N), [this, E,
+                                                       Ends](unsigned I) {
       unsigned Start = (I == 0) ? 0 : Ends[I - 1];
       return PrefView{
           const_cast<Expr *>(E[1 + I]),


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to