1 .. title:: clang-tidy - cppcoreguidelines-pro-bounds-constant-array-index
3 cppcoreguidelines-pro-bounds-constant-array-index
4 =================================================
6 This check flags all array subscript expressions on static arrays and
7 ``std::arrays`` that either do not have a constant integer expression index or
8 are out of bounds (for ``std::array``). For out-of-bounds checking of static
9 arrays, see the `-Warray-bounds` Clang diagnostic.
11 This rule is part of the `Bounds safety (Bounds 2)
12 <https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Pro-bounds-arrayindex>`_
13 profile from the C++ Core Guidelines.
15 Optionally, this check can generate fixes using ``gsl::at`` for indexing.
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"`.
25 .. option:: IncludeStyle
27 A string specifying which include-style is used, `llvm` or `google`. Default