|
2 | 2 | // RUN: %check_clang_tidy -std=c++14 %s modernize-use-constexpr %t -- -config="{CheckOptions: {modernize-use-constexpr.ConstexprString: 'CXPR'}}" |
3 | 3 | // RUN: %check_clang_tidy -std=c++17 %s modernize-use-constexpr %t -- -config="{CheckOptions: {modernize-use-constexpr.ConstexprString: 'CXPR'}}" |
4 | 4 | // RUN: %check_clang_tidy -std=c++20 %s modernize-use-constexpr %t -- -config="{CheckOptions: {modernize-use-constexpr.ConstexprString: 'CXPR'}}" |
5 | | -// RUN: %check_clang_tidy -std=c++23-or-later -check-suffix=23 %s modernize-use-constexpr %t -- -config="{CheckOptions: {modernize-use-constexpr.ConstexprString: 'CXPR'}}" |
6 | | -// RUN: %check_clang_tidy -std=c++23-or-later -check-suffix=23-STATIC %s modernize-use-constexpr %t -- -config="{CheckOptions: {modernize-use-constexpr.ConstexprString: 'CXPR', modernize-use-constexpr.StaticConstexprString: 'STATIC_CXPR'}}" |
| 5 | +// RUN: %check_clang_tidy -std=c++23-or-later %s modernize-use-constexpr %t -- -config="{CheckOptions: {modernize-use-constexpr.ConstexprString: 'CXPR'}}" |
| 6 | +// RUN: %check_clang_tidy -std=c++23-or-later %s modernize-use-constexpr %t -- -config="{CheckOptions: {modernize-use-constexpr.ConstexprString: 'CXPR', modernize-use-constexpr.StaticConstexprString: 'STATIC_CXPR'}}" |
7 | 7 |
|
8 | 8 | static int f1() { return 0; } |
9 | | -// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: function 'f1' can be declared 'constexpr' [modernize-use-constexpr] |
| 9 | +// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: declare function 'f1' as 'constexpr' [modernize-use-constexpr] |
10 | 10 | // CHECK-FIXES: static CXPR int f1() { return 0; } |
11 | | -// CHECK-MESSAGES-23: :[[@LINE-3]]:12: warning: function 'f1' can be declared 'constexpr' [modernize-use-constexpr] |
12 | | -// CHECK-FIXES-23: static CXPR int f1() { return 0; } |
13 | | -// CHECK-MESSAGES-23-STATIC: :[[@LINE-5]]:12: warning: function 'f1' can be declared 'constexpr' [modernize-use-constexpr] |
14 | | -// CHECK-FIXES-23-STATIC: static CXPR int f1() { return 0; } |
15 | 11 |
|
16 | 12 | #define FUNC(N) void func##N() |
17 | 13 | FUNC(0) { |
18 | 14 | static int f1 = 1; |
19 | 15 | static const int f2 = 2; |
20 | | - // CHECK-MESSAGES-23: :[[@LINE-1]]:22: warning: variable 'f2' can be declared 'constexpr' [modernize-use-constexpr] |
21 | | - // CHECK-FIXES-23: static CXPR int f2 = 2; |
22 | | - // CHECK-MESSAGES-23-STATIC: :[[@LINE-3]]:22: warning: variable 'f2' can be declared 'constexpr' [modernize-use-constexpr] |
23 | | - // CHECK-FIXES-23-STATIC: static CXPR int f2 = 2; |
| 16 | + // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: declare variable 'f2' as 'constexpr' [modernize-use-constexpr] |
| 17 | + // CHECK-FIXES: static CXPR int f2 = 2; |
24 | 18 | const int f3 = 3; |
25 | | - // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: variable 'f3' can be declared 'constexpr' [modernize-use-constexpr] |
| 19 | + // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: declare variable 'f3' as 'constexpr' [modernize-use-constexpr] |
26 | 20 | // CHECK-FIXES: CXPR int f3 = 3; |
27 | | - // CHECK-MESSAGES-23: :[[@LINE-3]]:15: warning: variable 'f3' can be declared 'constexpr' [modernize-use-constexpr] |
28 | | - // CHECK-FIXES-23: static CXPR int f3 = 3; |
29 | | - // CHECK-MESSAGES-23-STATIC: :[[@LINE-5]]:15: warning: variable 'f3' can be declared 'constexpr' [modernize-use-constexpr] |
30 | | - // CHECK-FIXES-23-STATIC: STATIC_CXPR int f3 = 3; |
31 | 21 | } |
32 | 22 |
|
0 commit comments