Skip to content

Commit d3a3df2

Browse files
committed
add array test cases
1 parent 4f80dc9 commit d3a3df2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

clang-tools-extra/test/clang-tidy/checkers/modernize/use-constexpr.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,16 @@ namespace variable {
319319
// CHECK-FIXES-11: static constexpr int D1 = f1();
320320
static const int E1 = g1();
321321

322+
static const int F1[] = {0,1,2,3,4};
323+
// CHECK-MESSAGES-11: :[[@LINE-1]]:26: warning: declare variable 'F1' as 'constexpr'
324+
// CHECK-FIXES-11: static constexpr int F1[] = {0,1,2,3,4};
325+
326+
static const int G1[] = {0,1,2,f1(),4};
327+
// CHECK-MESSAGES-11: :[[@LINE-1]]:26: warning: declare variable 'G1' as 'constexpr'
328+
// CHECK-FIXES-11: static constexpr int G1[] = {0,1,2,f1(),4};
329+
330+
static const int H1[] = {0,1,2,g1(),4};
331+
322332
template <typename T>
323333
const T TemplatedVar1 = T{};
324334
// CHECK-MESSAGES-11: :[[@LINE-1]]:17: warning: declare variable 'TemplatedVar1' as 'constexpr'

0 commit comments

Comments
 (0)