UNSUPPORT test on 64-bit AIX too
[llvm-project.git] / clang-tools-extra / clang-tidy / modernize / MakeSharedCheck.cpp
blob5ab3f3e26be2c81be95e88bdd6764f0d04d5fef0
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 {
17 namespace tidy {
18 namespace modernize {
20 MakeSharedCheck::MakeSharedCheck(StringRef Name, ClangTidyContext *Context)
21 : MakeSmartPtrCheck(Name, Context, "std::make_shared") {}
23 MakeSharedCheck::SmartPtrTypeMatcher
24 MakeSharedCheck::getSmartPointerTypeMatcher() const {
25 return qualType(hasUnqualifiedDesugaredType(
26 recordType(hasDeclaration(classTemplateSpecializationDecl(
27 hasName("::std::shared_ptr"), templateArgumentCountIs(1),
28 hasTemplateArgument(0, templateArgument(refersToType(
29 qualType().bind(PointerType)))))))));
32 } // namespace modernize
33 } // namespace tidy
34 } // namespace clang