Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:22

0001 //===--- NamedParameterCheck.h - clang-tidy ---------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H
0010 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H
0011 
0012 #include "../ClangTidyCheck.h"
0013 
0014 namespace clang::tidy::readability {
0015 
0016 /// Find functions with unnamed arguments.
0017 ///
0018 /// The check implements the following rule originating in the Google C++ Style
0019 /// Guide:
0020 ///
0021 /// https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions
0022 ///
0023 /// All parameters should be named, with identical names in the declaration and
0024 /// implementation.
0025 ///
0026 /// Corresponding cpplint.py check name: 'readability/function'.
0027 class NamedParameterCheck : public ClangTidyCheck {
0028 public:
0029   NamedParameterCheck(StringRef Name, ClangTidyContext *Context)
0030       : ClangTidyCheck(Name, Context) {}
0031   void registerMatchers(ast_matchers::MatchFinder *Finder) override;
0032   void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
0033   std::optional<TraversalKind> getCheckTraversalKind() const override {
0034     return TK_IgnoreUnlessSpelledInSource;
0035   }
0036 };
0037 
0038 } // namespace clang::tidy::readability
0039 
0040 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_NAMEDPARAMETERCHECK_H