|
1 |
| -// RUN: %check_clang_tidy -std=c++11-or-later %s readability-redundant-casting %t -- -- -fno-delayed-template-parsing |
2 |
| -// RUN: %check_clang_tidy -std=c++11-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++11-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,6 +65,12 @@ void testDiffrentTypesCast(B& value) {
|
57 | 65 | A& a7 = static_cast<A&>(value);
|
58 | 66 | }
|
59 | 67 |
|
| 68 | +#ifdef CXX_20 |
| 69 | +void testParenListInitExpr(A value) { |
| 70 | + B b = static_cast<B>(value); |
| 71 | +} |
| 72 | +#endif |
| 73 | + |
60 | 74 | void testCastingWithAuto() {
|
61 | 75 | auto a = getA();
|
62 | 76 | A& a8 = static_cast<A&>(a);
|
|
0 commit comments