annotate clang-tools-extra/clang-tidy/readability/StaticAccessedThroughInstanceCheck.h @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1f2b6ac9f198
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===--- StaticAccessedThroughInstanceCheck.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_READABILITY_STATIC_ACCESSED_THROUGH_INSTANCE_H
anatofuz
parents:
diff changeset
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STATIC_ACCESSED_THROUGH_INSTANCE_H
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 #include "../ClangTidyCheck.h"
anatofuz
parents:
diff changeset
13
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
14 namespace clang::tidy::readability {
150
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 /// Checks for member expressions that access static members through
anatofuz
parents:
diff changeset
17 /// instances and replaces them with uses of the appropriate qualified-id.
anatofuz
parents:
diff changeset
18 ///
anatofuz
parents:
diff changeset
19 /// For the user-facing documentation see:
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
20 /// http://clang.llvm.org/extra/clang-tidy/checks/readability/static-accessed-through-instance.html
150
anatofuz
parents:
diff changeset
21 class StaticAccessedThroughInstanceCheck : public ClangTidyCheck {
anatofuz
parents:
diff changeset
22 public:
anatofuz
parents:
diff changeset
23 StaticAccessedThroughInstanceCheck(StringRef Name, ClangTidyContext *Context)
anatofuz
parents:
diff changeset
24 : ClangTidyCheck(Name, Context),
anatofuz
parents:
diff changeset
25 NameSpecifierNestingThreshold(
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
26 Options.get("NameSpecifierNestingThreshold", 3U)) {}
150
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
anatofuz
parents:
diff changeset
29 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
anatofuz
parents:
diff changeset
30 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
31 std::optional<TraversalKind> getCheckTraversalKind() const override {
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
32 return TK_IgnoreUnlessSpelledInSource;
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
33 }
150
anatofuz
parents:
diff changeset
34
anatofuz
parents:
diff changeset
35 private:
anatofuz
parents:
diff changeset
36 const unsigned NameSpecifierNestingThreshold;
anatofuz
parents:
diff changeset
37 };
anatofuz
parents:
diff changeset
38
252
1f2b6ac9f198 LLVM16-1
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 236
diff changeset
39 } // namespace clang::tidy::readability
150
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_STATIC_ACCESSED_THROUGH_INSTANCE_H