clang-tools 22.0.0git
clang::tidy::abseil::RedundantStrcatCallsCheck Class Reference

Flags redundant calls to absl::StrCat when the result is being passed to another call of absl::StrCat/absl::StrAppend. More...

#include <RedundantStrcatCallsCheck.h>

Inheritance diagram for clang::tidy::abseil::RedundantStrcatCallsCheck:
[legend]

Public Member Functions

 RedundantStrcatCallsCheck (StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported (const LangOptions &LangOpts) const override
void registerMatchers (ast_matchers::MatchFinder *Finder) override
void check (const ast_matchers::MatchFinder::MatchResult &Result) override

Detailed Description

Flags redundant calls to absl::StrCat when the result is being passed to another call of absl::StrCat/absl::StrAppend.

Also suggests a fix to collapse the calls. Example: StrCat(1, StrCat(2, 3)) ==> StrCat(1, 2, 3)

For the user-facing documentation see: https://clang.llvm.org/extra/clang-tidy/checks/abseil/redundant-strcat-calls.html

Definition at line 24 of file RedundantStrcatCallsCheck.h.

Constructor & Destructor Documentation

◆ RedundantStrcatCallsCheck()

clang::tidy::abseil::RedundantStrcatCallsCheck::RedundantStrcatCallsCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 26 of file RedundantStrcatCallsCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::abseil::RedundantStrcatCallsCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 106 of file RedundantStrcatCallsCheck.cpp.

◆ isLanguageVersionSupported()

bool clang::tidy::abseil::RedundantStrcatCallsCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 28 of file RedundantStrcatCallsCheck.h.

◆ registerMatchers()

void clang::tidy::abseil::RedundantStrcatCallsCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 26 of file RedundantStrcatCallsCheck.cpp.


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