annotate clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===--- ProBoundsPointerArithmeticCheck.h - clang-tidy----------*- C++ -*-===//
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 //
anatofuz
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_POINTER_ARITHMETIC_H
anatofuz
parents:
diff changeset
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_POINTER_ARITHMETIC_H
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 #include "../ClangTidy.h"
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 namespace clang {
anatofuz
parents:
diff changeset
15 namespace tidy {
anatofuz
parents:
diff changeset
16 namespace cppcoreguidelines {
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 /// Flags all kinds of pointer arithmetic that have result of pointer type, i.e.
anatofuz
parents:
diff changeset
19 /// +, -, +=, -=, ++, --. In addition, the [] operator on pointers (not on
anatofuz
parents:
diff changeset
20 /// arrays) is flagged.
anatofuz
parents:
diff changeset
21 ///
anatofuz
parents:
diff changeset
22 /// For the user-facing documentation see:
anatofuz
parents:
diff changeset
23 /// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-pro-bounds-pointer-arithmetic.html
anatofuz
parents:
diff changeset
24 class ProBoundsPointerArithmeticCheck : public ClangTidyCheck {
anatofuz
parents:
diff changeset
25 public:
anatofuz
parents:
diff changeset
26 ProBoundsPointerArithmeticCheck(StringRef Name, ClangTidyContext *Context)
anatofuz
parents:
diff changeset
27 : ClangTidyCheck(Name, Context) {}
anatofuz
parents:
diff changeset
28 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
anatofuz
parents:
diff changeset
29 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
anatofuz
parents:
diff changeset
30 };
anatofuz
parents:
diff changeset
31
anatofuz
parents:
diff changeset
32 } // namespace cppcoreguidelines
anatofuz
parents:
diff changeset
33 } // namespace tidy
anatofuz
parents:
diff changeset
34 } // namespace clang
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CPPCOREGUIDELINES_PRO_BOUNDS_POINTER_ARITHMETIC_H