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

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