1.. title:: clang-tidy - cppcoreguidelines-pro-bounds-constant-array-index 2 3cppcoreguidelines-pro-bounds-constant-array-index 4================================================= 5 6This check flags all array subscript expressions on static arrays and 7``std::arrays`` that either do not have a constant integer expression index or 8are out of bounds (for ``std::array``). For out-of-bounds checking of static 9arrays, see the `-Warray-bounds` Clang diagnostic. 10 11This rule is part of the `Bounds safety (Bounds 2) 12<https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Pro-bounds-arrayindex>`_ 13profile from the C++ Core Guidelines. 14 15Optionally, this check can generate fixes using ``gsl::at`` for indexing. 16 17Options 18------- 19 20.. option:: GslHeader 21 22 The check can generate fixes after this option has been set to the name of 23 the include file that contains ``gsl::at()``, e.g. `"gsl/gsl.h"`. 24 25.. option:: IncludeStyle 26 27 A string specifying which include-style is used, `llvm` or `google`. Default 28 is `llvm`. 29