1 //===--- UniquePtrArrayMismatchCheck.h - clang-tidy -------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNIQUEPTRARRAYMISMATCHCHECK_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNIQUEPTRARRAYMISMATCHCHECK_H
12 #include "SmartPtrArrayMismatchCheck.h"
14 namespace clang::tidy::bugprone
{
16 /// Finds initializations of C++ unique pointers to non-array type that are
17 /// initialized with an array.
22 /// std::unique_ptr<int> PtrArr{new int[10]};
24 class UniquePtrArrayMismatchCheck
: public SmartPtrArrayMismatchCheck
{
26 UniquePtrArrayMismatchCheck(StringRef Name
, ClangTidyContext
*Context
);
29 SmartPtrClassMatcher
getSmartPointerClassMatcher() const override
;
32 } // namespace clang::tidy::bugprone
34 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNIQUEPTRARRAYMISMATCHCHECK_H