================
@@ -0,0 +1,179 @@
+// RUN: %check_clang_tidy %s readability-avoid-default-lambda-capture %t -- -- 
-Wno-vla-extension -std=c++20
----------------
localspook wrote:

This is a problem that comes up a lot of checks. There are broadly two ways you 
can handle it:
1. Split the C++20 tests into a different file 
(`avoid-default-lambda-capture-cxx20.cpp`) and at the top put:
   ```cpp
   // RUN: %check_clang_tidy -std=c++20-or-later %s 
readability-avoid-default-lambda-capture %t -- -- -Wno-vla-extension
   ```
2. Keep the tests in one file and at the top put:
   ```cpp
   // RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s 
readability-avoid-default-lambda-capture %t -- -- -Wno-vla-extension
   // RUN: %check_clang_tidy -std=c++20-or-later -check-suffixes=,20 %s 
readability-avoid-default-lambda-capture %t -- -- -Wno-vla-extension
   ```
   Then guard the uses of C++20 features with `#if __cplusplus >= 202002L`, and 
change the adjacent  `// CHECK-NOTES` and `// CHECK-FIXES`  to `// 
CHECK-NOTES-20` and `// CHECK-FIXES-20`.

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

Reply via email to