18 MakeUniqueCheck::MakeUniqueCheck(StringRef
Name,
21 RequireCPlusPlus14(Options.get(
"MakeSmartPtrFunction",
"").empty()) {}
25 return qualType(hasUnqualifiedDesugaredType(
26 recordType(hasDeclaration(classTemplateSpecializationDecl(
27 hasName(
"::std::unique_ptr"), templateArgumentCountIs(2),
29 0, templateArgument(refersToType(qualType().bind(
PointerType)))),
31 1, templateArgument(refersToType(
32 qualType(hasDeclaration(classTemplateSpecializationDecl(
33 hasName(
"::std::default_delete"),
34 templateArgumentCountIs(1),
36 0, templateArgument(refersToType(qualType(
41 const LangOptions &LangOpts)
const {
42 return RequireCPlusPlus14 ? LangOpts.CPlusPlus14 : LangOpts.CPlusPlus11;
ast_matchers::internal::BindableMatcher< QualType > SmartPtrTypeMatcher
SmartPtrTypeMatcher getSmartPointerTypeMatcher() const override
Returns matcher that match with different smart pointer types.
static constexpr llvm::StringLiteral Name
static const char PointerType[]
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Returns whether the C++ version is compatible with current check.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Base class for MakeSharedCheck and MakeUniqueCheck.