1// RUN: %check_clang_tidy %s modernize-avoid-c-arrays %t
2
3int not_main(int argc, char *argv[]) {
4 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: do not declare C-style arrays, use std::array<> 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
9int main(int argc, char *argv[]) {
10 int f5[] = {1, 2};
11 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: do not declare C-style arrays, use std::array<> instead
12
13 auto not_main = [](int argc, char *argv[]) {
14 // CHECK-MESSAGES: :[[@LINE-1]]:32: warning: do not declare C-style arrays, use std::array<> instead
15 int f6[] = {1, 2};
16 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: do not declare C-style arrays, use std::array<> instead
17 };
18}
19

source code of clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-ignores-main.cpp