Debian Codegraph @

clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-ignores-strings.cpp

raw
1 // RUN: %check_clang_tidy %s modernize-avoid-c-arrays %t -- \
2 // RUN: -config='{CheckOptions: { modernize-avoid-c-arrays.AllowStringArrays: true }}'
3
4 const char name[] = "name";
5 const char array[] = {'n', 'a', 'm', 'e', '\0'};
6 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: do not declare C-style arrays, use std::array<> instead [modernize-avoid-c-arrays]
7
8 void takeCharArray(const char name[]);
9 // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: do not declare C-style arrays, use std::array<> instead [modernize-avoid-c-arrays]