mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-30 17:21:10 +00:00
[clang-tidy] Fix typedefs handling in bugprone-dangling-handle
Using 'hasUnqualifiedDesugaredType' to skip all type aliases when checking for handle. Fixes #38779 Reviewed By: carlosgalvezp Differential Revision: https://reviews.llvm.org/D148418
This commit is contained in:
parent
9a888c7679
commit
35f466eb14
@ -25,7 +25,8 @@ handleFrom(const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle,
|
||||
return expr(
|
||||
anyOf(cxxConstructExpr(hasDeclaration(cxxMethodDecl(ofClass(IsAHandle))),
|
||||
hasArgument(0, Arg)),
|
||||
cxxMemberCallExpr(hasType(cxxRecordDecl(IsAHandle)),
|
||||
cxxMemberCallExpr(hasType(hasUnqualifiedDesugaredType(recordType(
|
||||
hasDeclaration(cxxRecordDecl(IsAHandle))))),
|
||||
callee(memberExpr(member(cxxConversionDecl()))),
|
||||
on(Arg))));
|
||||
}
|
||||
|
@ -174,6 +174,10 @@ Changes in existing checks
|
||||
arguments to ``std::print``, ``std::format`` or other functions listed in
|
||||
the ``StringParameterFunction`` check option.
|
||||
|
||||
- Improved :doc:`bugprone-dangling-handle
|
||||
<clang-tidy/checks/bugprone/dangling-handle>` check enhancing detection of
|
||||
handles behind type aliases.
|
||||
|
||||
- Deprecated check-local options `HeaderFileExtensions`
|
||||
in :doc:`bugprone-dynamic-static-initializers
|
||||
<clang-tidy/checks/bugprone/dynamic-static-initializers>` check.
|
||||
|
@ -52,7 +52,8 @@ class basic_string {
|
||||
basic_string();
|
||||
basic_string(const char*);
|
||||
|
||||
operator basic_string_view() const noexcept;
|
||||
typedef basic_string_view str_view;
|
||||
operator str_view() const noexcept;
|
||||
|
||||
~basic_string();
|
||||
};
|
||||
@ -193,3 +194,4 @@ void Negatives(std::string_view default_arg = ReturnsAString()) {
|
||||
|
||||
TakesAStringView(std::string());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user