[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang-tools-extra / clang-tidy / bugprone / SharedPtrArrayMismatchCheck.cpp
blob72036aaff158cf56d0692c39419a73766d707639
1 //===--- SharedPtrArrayMismatchCheck.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 "SharedPtrArrayMismatchCheck.h"
11 using namespace clang::ast_matchers;
13 namespace clang::tidy::bugprone {
15 SharedPtrArrayMismatchCheck::SharedPtrArrayMismatchCheck(
16 StringRef Name, ClangTidyContext *Context)
17 : SmartPtrArrayMismatchCheck(Name, Context, "shared") {}
19 SharedPtrArrayMismatchCheck::SmartPtrClassMatcher
20 SharedPtrArrayMismatchCheck::getSmartPointerClassMatcher() const {
21 return classTemplateSpecializationDecl(
22 hasName("::std::shared_ptr"), templateArgumentCountIs(1),
23 hasTemplateArgument(
24 0, templateArgument(refersToType(qualType().bind(PointerTypeN)))));
27 } // namespace clang::tidy::bugprone