brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 4eddeb4 Raw
30 lines · plain
1.. title:: clang-tidy - cppcoreguidelines-pro-bounds-constant-array-index2 3cppcoreguidelines-pro-bounds-constant-array-index4=================================================5 6This check flags all array subscript expressions on static arrays and7``std::arrays`` that either do not have a constant integer expression index or8are out of bounds (for ``std::array``). For out-of-bounds checking of static9arrays, 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 17Options18-------19 20.. option:: GslHeader21 22   The check can generate fixes after this option has been set to the name of23   the include file that contains ``gsl::at()``, e.g. `"gsl/gsl.h"`.24   Default is an empty string.25 26.. option:: IncludeStyle27 28   A string specifying which include-style is used, `llvm` or `google`. Default29   is `llvm`.30