17 MakeUniqueCheck::MakeUniqueCheck(StringRef
Name,
20 RequireCPlusPlus14(Options.get(
"MakeSmartPtrFunction",
"").empty()) {}
24 return qualType(hasUnqualifiedDesugaredType(
25 recordType(hasDeclaration(classTemplateSpecializationDecl(
26 hasName(
"::std::unique_ptr"), templateArgumentCountIs(2),
28 0, templateArgument(refersToType(qualType().bind(
PointerType)))),
30 1, templateArgument(refersToType(
31 qualType(hasDeclaration(classTemplateSpecializationDecl(
32 hasName(
"::std::default_delete"),
33 templateArgumentCountIs(1),
35 0, templateArgument(refersToType(qualType(
40 const LangOptions &LangOpts)
const {
41 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.