1 // RUN: %check_clang_tidy -std=c++17 %s modernize-avoid-c-arrays %t 2 3 int not_main(int argc, char *argv[]) { 4 // CHECK-MESSAGES: :[[@LINE-1]]:24: warning: do not declare C-style arrays, use 'std::array' or 'std::vector' 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 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' or 'std::vector' 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