xref: /llvm-project/clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-c++20.cpp (revision 5fa742eeed0821baf864d23f237ff1b481e1ae11)
1 // RUN: %check_clang_tidy -std=c++20 %s modernize-avoid-c-arrays %t
2 
3 int f1(int data[], int size) {
4   // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: do not declare C-style arrays, use 'std::span' instead
5   int f4[] = {1, 2};
6   // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not declare C-style arrays, use 'std::array' instead
7 }
8 
9 int f2(int data[100]) {
10   // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: do not declare C-style arrays, use 'std::array' instead
11 }
12