35 lines · c
1//===----------------------------------------------------------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNIQUEPTRARRAYMISMATCHCHECK_H10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNIQUEPTRARRAYMISMATCHCHECK_H11 12#include "SmartPtrArrayMismatchCheck.h"13 14namespace clang::tidy::bugprone {15 16/// Finds initializations of C++ unique pointers to non-array type that are17/// initialized with an array.18///19/// Example:20///21/// \code22/// std::unique_ptr<int> PtrArr{new int[10]};23/// \endcode24class UniquePtrArrayMismatchCheck : public SmartPtrArrayMismatchCheck {25public:26 UniquePtrArrayMismatchCheck(StringRef Name, ClangTidyContext *Context);27 28protected:29 SmartPtrClassMatcher getSmartPointerClassMatcher() const override;30};31 32} // namespace clang::tidy::bugprone33 34#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNIQUEPTRARRAYMISMATCHCHECK_H35