18 RequireCPlusPlus14(Options.get(
"MakeSmartPtrFunction",
"").
empty()) {}
22 return qualType(hasUnqualifiedDesugaredType(
23 recordType(hasDeclaration(classTemplateSpecializationDecl(
24 hasName(
"::std::unique_ptr"), templateArgumentCountIs(2),
26 0, templateArgument(refersToType(qualType().bind(
PointerType)))),
28 1, templateArgument(refersToType(
29 qualType(hasDeclaration(classTemplateSpecializationDecl(
30 hasName(
"::std::default_delete"),
31 templateArgumentCountIs(1),
33 0, templateArgument(refersToType(qualType(
38 const LangOptions &LangOpts)
const {
39 return RequireCPlusPlus14 ? LangOpts.CPlusPlus14 : LangOpts.CPlusPlus11;
llvm::SmallString< 256U > Name
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Base class for MakeSharedCheck and MakeUniqueCheck.
static const char PointerType[]
ast_matchers::internal::BindableMatcher< QualType > SmartPtrTypeMatcher
MakeUniqueCheck(StringRef Name, ClangTidyContext *Context)
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override
Returns whether the C++ version is compatible with current check.
SmartPtrTypeMatcher getSmartPointerTypeMatcher() const override
Returns matcher that match with different smart pointer types.
static bool empty(SourceRange Range)