Skip to content

Commit 13620f1

Browse files
committed
[clang-tidy] keep tests for c++11,14,17
1 parent 46f7326 commit 13620f1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

clang-tools-extra/test/clang-tidy/checkers/readability/redundant-casting.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
// RUN: %check_clang_tidy -std=c++20-or-later %s readability-redundant-casting %t -- -- -fno-delayed-template-parsing
2-
// RUN: %check_clang_tidy -std=c++20-or-later -check-suffix=,MACROS %s readability-redundant-casting %t -- \
1+
// RUN: %check_clang_tidy -std=c++11,c++14,c++17 %s readability-redundant-casting %t -- -- -fno-delayed-template-parsing
2+
// RUN: %check_clang_tidy -std=c++11,c++14,c++17 -check-suffix=,MACROS %s readability-redundant-casting %t -- \
33
// RUN: -config='{CheckOptions: { readability-redundant-casting.IgnoreMacros: false }}' \
44
// RUN: -- -fno-delayed-template-parsing
5-
// RUN: %check_clang_tidy -std=c++20-or-later -check-suffix=,ALIASES %s readability-redundant-casting %t -- \
5+
// RUN: %check_clang_tidy -std=c++11,c++14,c++17 -check-suffix=,ALIASES %s readability-redundant-casting %t -- \
66
// RUN: -config='{CheckOptions: { readability-redundant-casting.IgnoreTypeAliases: true }}' \
77
// RUN: -- -fno-delayed-template-parsing
8+
// RUN: %check_clang_tidy -std=c++20 %s readability-redundant-casting %t -- \
9+
// RUN: -- -fno-delayed-template-parsing -D CXX_20=1
10+
// RUN: %check_clang_tidy -std=c++20 -check-suffix=,MACROS %s readability-redundant-casting %t -- \
11+
// RUN: -config='{CheckOptions: { readability-redundant-casting.IgnoreMacros: false }}' \
12+
// RUN: -- -fno-delayed-template-parsing -D CXX_20=1
13+
// RUN: %check_clang_tidy -std=c++20 -check-suffix=,ALIASES %s readability-redundant-casting %t -- \
14+
// RUN: -config='{CheckOptions: { readability-redundant-casting.IgnoreTypeAliases: true }}' \
15+
// RUN: -- -fno-delayed-template-parsing -D CXX_20=1
816

917
struct A {};
1018
struct B : A {};
@@ -57,9 +65,11 @@ void testDiffrentTypesCast(B& value) {
5765
A& a7 = static_cast<A&>(value);
5866
}
5967

68+
#ifdef CXX_20
6069
void testParenListInitExpr(A value) {
6170
B b = static_cast<B>(value);
6271
}
72+
#endif
6373

6474
void testCastingWithAuto() {
6575
auto a = getA();

0 commit comments

Comments
 (0)