[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang-tools-extra / clang-tidy / modernize / MakeSharedCheck.cpp
blob69f7d9f69eeed0cf2420a1448519177e19efa643
1 //===--- MakeSharedCheck.cpp - clang-tidy----------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "MakeSharedCheck.h"
11 // FixItHint - Hint to check documentation script to mark this check as
12 // providing a FixIt.
14 using namespace clang::ast_matchers;
16 namespace clang::tidy::modernize {
18 MakeSharedCheck::MakeSharedCheck(StringRef Name, ClangTidyContext *Context)
19 : MakeSmartPtrCheck(Name, Context, "std::make_shared") {}
21 MakeSharedCheck::SmartPtrTypeMatcher
22 MakeSharedCheck::getSmartPointerTypeMatcher() const {
23 return qualType(hasUnqualifiedDesugaredType(
24 recordType(hasDeclaration(classTemplateSpecializationDecl(
25 hasName("::std::shared_ptr"), templateArgumentCountIs(1),
26 hasTemplateArgument(0, templateArgument(refersToType(
27 qualType().bind(PointerType)))))))));
30 } // namespace clang::tidy::modernize