annotate clang-tools-extra/clang-tidy/readability/NamedParameterCheck.h @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 79ff65ed7e25
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===--- NamedParameterCheck.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_NAMEDPARAMETERCHECK_H
anatofuz
parents:
diff changeset
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 #include "../ClangTidyCheck.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 readability {
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 /// Find functions with unnamed arguments.
anatofuz
parents:
diff changeset
19 ///
anatofuz
parents:
diff changeset
20 /// The check implements the following rule originating in the Google C++ Style
anatofuz
parents:
diff changeset
21 /// Guide:
anatofuz
parents:
diff changeset
22 ///
anatofuz
parents:
diff changeset
23 /// https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions
anatofuz
parents:
diff changeset
24 ///
anatofuz
parents:
diff changeset
25 /// All parameters should be named, with identical names in the declaration and
anatofuz
parents:
diff changeset
26 /// implementation.
anatofuz
parents:
diff changeset
27 ///
anatofuz
parents:
diff changeset
28 /// Corresponding cpplint.py check name: 'readability/function'.
anatofuz
parents:
diff changeset
29 class NamedParameterCheck : public ClangTidyCheck {
anatofuz
parents:
diff changeset
30 public:
anatofuz
parents:
diff changeset
31 NamedParameterCheck(StringRef Name, ClangTidyContext *Context)
anatofuz
parents:
diff changeset
32 : ClangTidyCheck(Name, Context) {}
anatofuz
parents:
diff changeset
33 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
anatofuz
parents:
diff changeset
34 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
35 llvm::Optional<TraversalKind> getCheckTraversalKind() const override {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
36 return TK_IgnoreUnlessSpelledInSource;
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
37 }
150
anatofuz
parents:
diff changeset
38 };
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 } // namespace readability
anatofuz
parents:
diff changeset
41 } // namespace tidy
anatofuz
parents:
diff changeset
42 } // namespace clang
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H