[clang-tools-extra] b4d9ac8 - [C++20][ClangTidy] Update the ClangTidy tests to also test in C++20 mode
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 2 04:03:00 PST 2023
Author: Utkarsh Saxena
Date: 2023-03-02T13:02:51+01:00
New Revision: b4d9ac8b453e20e4223b5935c700698608a6425c
URL: https://github.com/llvm/llvm-project/commit/b4d9ac8b453e20e4223b5935c700698608a6425c
DIFF: https://github.com/llvm/llvm-project/commit/b4d9ac8b453e20e4223b5935c700698608a6425c.diff
LOG: [C++20][ClangTidy] Update the ClangTidy tests to also test in C++20 mode
Differential Revision: https://reviews.llvm.org/D144480
Added:
Modified:
clang-tools-extra/test/clang-tidy/checkers/bugprone/dangling-handle.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-implicits.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler.cpp
clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-exception-at-new.cpp
clang-tools-extra/test/clang-tidy/checkers/cert/throw-exception-type.cpp
clang-tools-extra/test/clang-tidy/checkers/misc/static-assert.cpp
clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-copy-initialization.cpp
clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type-macros.cpp
clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type.cpp
clang-tools-extra/test/clang-tidy/checkers/readability/isolate-declaration-cxx17.cpp
clang-tools-extra/test/clang-tidy/checkers/readability/use-anyofallof.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/dangling-handle.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/dangling-handle.cpp
index d3caf73b88c14..349875a3c99cd 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone/dangling-handle.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/dangling-handle.cpp
@@ -2,7 +2,7 @@
// RUN: -config="{CheckOptions: \
// RUN: [{key: bugprone-dangling-handle.HandleClasses, \
// RUN: value: 'std::basic_string_view; ::llvm::StringRef;'}]}"
-// FIXME: Fix the checker to work in C++17 mode.
+// FIXME: Fix the checker to work in C++17 or later mode.
namespace std {
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-implicits.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-implicits.cpp
index ba7aa44a8731a..6c09ab0d89cc3 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-implicits.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-implicits.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy -std=c++17 %s bugprone-easily-swappable-parameters %t \
+// RUN: %check_clang_tidy -std=c++17-or-later %s bugprone-easily-swappable-parameters %t \
// RUN: -config='{CheckOptions: [ \
// RUN: {key: bugprone-easily-swappable-parameters.MinimumLength, value: 2}, \
// RUN: {key: bugprone-easily-swappable-parameters.IgnoredParameterNames, value: ""}, \
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp
index 047da60796298..142c8b114b7c8 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp
@@ -4,6 +4,7 @@
// RUN: {key: bugprone-exception-escape.FunctionsThatShouldNotThrow, value: 'enabled1,enabled2,enabled3'} \
// RUN: ]}" \
// RUN: -- -fexceptions
+// FIXME: Fix the checker to work in C++17 or later mode.
struct throwing_destructor {
~throwing_destructor() {
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler.cpp
index edb152568abf6..f1dc5ede35f29 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/signal-handler.cpp
@@ -1,5 +1,5 @@
// RUN: %check_clang_tidy -std=c++14 %s bugprone-signal-handler %t -- -- -isystem %clang_tidy_headers -isystem %S/Inputs/signal-handler -target x86_64-unknown-unknown
-
+// FIXME: Fix the checker to work in C++17 or later mode.
#include "stdcpp.h"
#include "stdio.h"
diff --git a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-exception-at-new.cpp b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-exception-at-new.cpp
index 6883463b0ae59..297db099f0667 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-exception-at-new.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/bugprone/unhandled-exception-at-new.cpp
@@ -1,5 +1,5 @@
// RUN: %check_clang_tidy -std=c++14 %s bugprone-unhandled-exception-at-new %t -- -- -fexceptions
-
+// FIXME: Fix the checker to work in C++17 or later mode.
namespace std {
typedef __typeof__(sizeof(0)) size_t;
enum class align_val_t : std::size_t {};
diff --git a/clang-tools-extra/test/clang-tidy/checkers/cert/throw-exception-type.cpp b/clang-tools-extra/test/clang-tidy/checkers/cert/throw-exception-type.cpp
index 17884ec4cc359..34ca83795c397 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/cert/throw-exception-type.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/cert/throw-exception-type.cpp
@@ -1,7 +1,7 @@
// RUN: %check_clang_tidy -std=c++11,c++14 %s cert-err60-cpp %t -- -- -fcxx-exceptions
// FIXME: Split off parts of this test that rely on dynamic exception
// specifications, and run this test in all language modes.
-
+// FIXME: Fix the checker to work in C++17 or later mode.
struct S {};
struct T : S {};
struct U {
diff --git a/clang-tools-extra/test/clang-tidy/checkers/misc/static-assert.cpp b/clang-tools-extra/test/clang-tidy/checkers/misc/static-assert.cpp
index d4d083640d162..da4ab9baa3948 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/misc/static-assert.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/misc/static-assert.cpp
@@ -1,5 +1,5 @@
// RUN: %check_clang_tidy -std=c++11 -check-suffixes=,CXX11 %s misc-static-assert %t
-// RUN: %check_clang_tidy -std=c++17 -check-suffixes=,CXX17 %s misc-static-assert %t
+// RUN: %check_clang_tidy -std=c++17-or-later -check-suffixes=,CXX17 %s misc-static-assert %t
void abort() {}
#ifdef NDEBUG
diff --git a/clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-copy-initialization.cpp b/clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-copy-initialization.cpp
index 5eac571c2afa7..2491aab86f1ad 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-copy-initialization.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/performance/unnecessary-copy-initialization.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy -std=c++17 %s performance-unnecessary-copy-initialization %t
+// RUN: %check_clang_tidy -std=c++17-or-later %s performance-unnecessary-copy-initialization %t
template <typename T>
struct Iterator {
diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type-macros.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type-macros.cpp
index 1e92759364ff4..d1b33bca64298 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type-macros.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type-macros.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy -std=c++14 %s readability-const-return-type %t -- \
+// RUN: %check_clang_tidy -std=c++14-or-later %s readability-const-return-type %t -- \
// RUN: -config="{CheckOptions: [{key: readability-const-return-type.IgnoreMacros, value: false}]}"
// p# = positive test
diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type.cpp
index 5577060c402a8..10b2858c9caa8 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/readability/const-return-type.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy -std=c++14 %s readability-const-return-type %t
+// RUN: %check_clang_tidy -std=c++14-or-later %s readability-const-return-type %t
// p# = positive test
// n# = negative test
diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/isolate-declaration-cxx17.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/isolate-declaration-cxx17.cpp
index ac2652771a81b..f42f2f37155af 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/readability/isolate-declaration-cxx17.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/readability/isolate-declaration-cxx17.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy -std=c++17 %s readability-isolate-declaration %t
+// RUN: %check_clang_tidy -std=c++17-or-later %s readability-isolate-declaration %t
template <typename T1, typename T2>
struct pair {
diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/use-anyofallof.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/use-anyofallof.cpp
index bf4fe0e58da95..7f8f16488d37a 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/readability/use-anyofallof.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/readability/use-anyofallof.cpp
@@ -1,4 +1,5 @@
// RUN: %check_clang_tidy -std=c++14,c++17 %s readability-use-anyofallof %t -- -- -fexceptions
+// FIXME: Fix the checker to work in C++20 mode.
bool good_any_of() {
int v[] = {1, 2, 3};
More information about the cfe-commits
mailing list