diff options
| author | Alexander Kornienko <alexfh@google.com> | 2016-01-27 11:37:19 +0000 |
|---|---|---|
| committer | Alexander Kornienko <alexfh@google.com> | 2016-01-27 11:37:19 +0000 |
| commit | 1b290adc43edc3190b8939088bda874688ca3ed8 (patch) | |
| tree | f78e3fe7fb18393aa2349a9d42c9a48c64bb0df6 /clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.rst | |
| parent | e267dafc13195a1389bc9dc94cdc52eb1c36ae40 (diff) | |
| download | bcm5719-llvm-1b290adc43edc3190b8939088bda874688ca3ed8.tar.gz bcm5719-llvm-1b290adc43edc3190b8939088bda874688ca3ed8.zip | |
[clang-tidy] Fix documentation.
Fixed broken links to cppcoreguidelines (anchors specified in the .md file
should be used, not automatic anchors generated by github).
Fixed formatting, array_view -> span, fixed sphinx errors in
misc-definitions-in-headers.rst.
llvm-svn: 258926
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.rst')
| -rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.rst | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.rst index 870dbf87ee0..e0660df2985 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.rst @@ -3,10 +3,12 @@ cppcoreguidelines-pro-bounds-pointer-arithmetic =============================================== -This check flags all usage of pointer arithmetic, because it could lead to an invalid pointer. -Subtraction of two pointers is not flagged by this check. +This check flags all usage of pointer arithmetic, because it could lead to an +invalid pointer. Subtraction of two pointers is not flagged by this check. -Pointers should only refer to single objects, and pointer arithmetic is fragile and easy to get wrong. array_view is a bounds-checked, safe type for accessing arrays of data. +Pointers should only refer to single objects, and pointer arithmetic is fragile +and easy to get wrong. ``span<T>`` is a bounds-checked, safe type for accessing +arrays of data. This rule is part of the "Bounds safety" profile of the C++ Core Guidelines, see -https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-bounds1-dont-use-pointer-arithmetic-use-array_view-instead +https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Pro-bounds-arithmetic. |

