clang-tools 22.0.0git
clang::tidy::portability::StdAllocatorConstCheck Class Reference

Report use of std::vector<const T> (and similar containers of const / elements). More...

#include <StdAllocatorConstCheck.h>

Inheritance diagram for clang::tidy::portability::StdAllocatorConstCheck:
[legend]

Public Member Functions

 StdAllocatorConstCheck (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

Report use of std::vector<const T> (and similar containers of const / elements).

These are not allowed in standard C++ due to undefined / std::allocator<const T>. They do not compile with libstdc++ or MSVC.

For the user-facing documentation see:
https://clang.llvm.org/extra/clang-tidy/checks/portability/std-allocator-const.html 

Definition at line 22 of file StdAllocatorConstCheck.h.

Constructor & Destructor Documentation

◆ StdAllocatorConstCheck()

clang::tidy::portability::StdAllocatorConstCheck::StdAllocatorConstCheck ( StringRef Name,
ClangTidyContext * Context )
inline

Definition at line 24 of file StdAllocatorConstCheck.h.

Member Function Documentation

◆ check()

void clang::tidy::portability::StdAllocatorConstCheck::check ( const ast_matchers::MatchFinder::MatchResult & Result)
override

Definition at line 55 of file StdAllocatorConstCheck.cpp.

◆ isLanguageVersionSupported()

bool clang::tidy::portability::StdAllocatorConstCheck::isLanguageVersionSupported ( const LangOptions & LangOpts) const
inlineoverride

Definition at line 26 of file StdAllocatorConstCheck.h.

◆ registerMatchers()

void clang::tidy::portability::StdAllocatorConstCheck::registerMatchers ( ast_matchers::MatchFinder * Finder)
override

Definition at line 16 of file StdAllocatorConstCheck.cpp.


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