|
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 -- \ |
3 | 3 | // RUN: -config='{CheckOptions: { readability-redundant-casting.IgnoreMacros: false }}' \ |
4 | 4 | // 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 -- \ |
6 | 6 | // RUN: -config='{CheckOptions: { readability-redundant-casting.IgnoreTypeAliases: true }}' \ |
7 | 7 | // 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 |
8 | 16 |
|
9 | 17 | struct A {}; |
10 | 18 | struct B : A {}; |
@@ -57,9 +65,11 @@ void testDiffrentTypesCast(B& value) { |
57 | 65 | A& a7 = static_cast<A&>(value); |
58 | 66 | } |
59 | 67 |
|
| 68 | +#ifdef CXX_20 |
60 | 69 | void testParenListInitExpr(A value) { |
61 | 70 | B b = static_cast<B>(value); |
62 | 71 | } |
| 72 | +#endif |
63 | 73 |
|
64 | 74 | void testCastingWithAuto() { |
65 | 75 | auto a = getA(); |
|
0 commit comments