clang-tools 23.0.0git
clang::tidy::llvm_check::FormatvStringCheck Class Reference

Validates llvm::formatv format strings against the provided arguments. More...

#include <FormatvStringCheck.h>

Inheritance diagram for clang::tidy::llvm_check::FormatvStringCheck:
[legend]

Public Member Functions

 FormatvStringCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void storeOptions (ClangTidyOptions::OptionMap &Opts) override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override
std::optional< TraversalKind > getCheckTraversalKind () const override

Detailed Description

Validates llvm::formatv format strings against the provided arguments.

Checks that:

  • The number of format indices matches the number of arguments.
  • Every argument is used by the format string.
  • Automatic and explicit indices are not mixed.

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/llvm/formatv-string.html

Definition at line 26 of file FormatvStringCheck.h.

Constructor & Destructor Documentation

◆ FormatvStringCheck()

clang::tidy::llvm_check::FormatvStringCheck::FormatvStringCheck ( StringRef Name,
ClangTidyContext * Context )

Member Function Documentation

◆ check()

void clang::tidy::llvm_check::FormatvStringCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

◆ getCheckTraversalKind()

std::optional< TraversalKind > clang::tidy::llvm_check::FormatvStringCheck::getCheckTraversalKind ( ) const
inlineoverride

Definition at line 36 of file FormatvStringCheck.h.

◆ isLanguageVersionSupported()

bool clang::tidy::llvm_check::FormatvStringCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 29 of file FormatvStringCheck.h.

◆ registerMatchers()

void clang::tidy::llvm_check::FormatvStringCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 97 of file FormatvStringCheck.cpp.

◆ storeOptions()

void clang::tidy::llvm_check::FormatvStringCheck::storeOptions ( ClangTidyOptions::OptionMap & Opts)
override

Definition at line 93 of file FormatvStringCheck.cpp.


The documentation for this class was generated from the following files: