clang-tools
20.0.0git
llvm-project
clang-tools-extra
clang-tidy
bugprone
UniquePtrArrayMismatchCheck.h
Go to the documentation of this file.
1
//===--- UniquePtrArrayMismatchCheck.h - clang-tidy -------------*- C++ -*-===//
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
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNIQUEPTRARRAYMISMATCHCHECK_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNIQUEPTRARRAYMISMATCHCHECK_H
11
12
#include "
SmartPtrArrayMismatchCheck.h
"
13
14
namespace
clang::tidy::bugprone
{
15
16
/// Finds initializations of C++ unique pointers to non-array type that are
17
/// initialized with an array.
18
///
19
/// Example:
20
///
21
/// \code
22
/// std::unique_ptr<int> PtrArr{new int[10]};
23
/// \endcode
24
class
UniquePtrArrayMismatchCheck
:
public
SmartPtrArrayMismatchCheck
{
25
public
:
26
UniquePtrArrayMismatchCheck
(StringRef
Name
,
ClangTidyContext
*Context);
27
28
protected
:
29
SmartPtrClassMatcher
getSmartPointerClassMatcher
()
const override
;
30
};
31
32
}
// namespace clang::tidy::bugprone
33
34
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_UNIQUEPTRARRAYMISMATCHCHECK_H
Name
llvm::SmallString< 256U > Name
Definition:
ChainedComparisonCheck.cpp:42
SmartPtrArrayMismatchCheck.h
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition:
ClangTidyDiagnosticConsumer.h:69
clang::tidy::bugprone::SmartPtrArrayMismatchCheck
Find constructions of smart (unique or shared) pointers where the pointer is declared with non-array ...
Definition:
SmartPtrArrayMismatchCheck.h:19
clang::tidy::bugprone::SmartPtrArrayMismatchCheck::SmartPtrClassMatcher
ast_matchers::internal::BindableMatcher< Decl > SmartPtrClassMatcher
Definition:
SmartPtrArrayMismatchCheck.h:32
clang::tidy::bugprone::UniquePtrArrayMismatchCheck
Finds initializations of C++ unique pointers to non-array type that are initialized with an array.
Definition:
UniquePtrArrayMismatchCheck.h:24
clang::tidy::bugprone::UniquePtrArrayMismatchCheck::getSmartPointerClassMatcher
SmartPtrClassMatcher getSmartPointerClassMatcher() const override
Returns matcher that match with different smart pointer classes.
Definition:
UniquePtrArrayMismatchCheck.cpp:20
clang::tidy::bugprone
Definition:
ArgumentCommentCheck.cpp:19
Generated on Thu Nov 21 2024 14:00:57 for clang-tools by
1.9.6