aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2025-03-19 21:36:10 -0300
committerGitHub <noreply@github.com>2025-03-19 21:36:10 -0300
commitfd7be0d2e9e2cb7d43c9cb97edbb36da59a5b595 (patch)
tree7c30c918ec042a49600d39953fe0377fa3b7962d /clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp
parent2c91f10362502ebfb464691cdde1ba05be7cb50e (diff)
downloadllvm-fd7be0d2e9e2cb7d43c9cb97edbb36da59a5b595.zip
llvm-fd7be0d2e9e2cb7d43c9cb97edbb36da59a5b595.tar.gz
llvm-fd7be0d2e9e2cb7d43c9cb97edbb36da59a5b595.tar.bz2
[clang] NFC: Clear some uses of MemberPointerType::getClass (#131965)
Diffstat (limited to 'clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp
index 9d1d92b..a8a9e6b 100644
--- a/clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/ComparePointerToMemberVirtualFunctionCheck.cpp
@@ -70,10 +70,7 @@ void ComparePointerToMemberVirtualFunctionCheck::check(
// compare with variable which type is pointer to member function.
llvm::SmallVector<SourceLocation, 12U> SameSignatureVirtualMethods{};
const auto *MPT = cast<MemberPointerType>(DRE->getType().getCanonicalType());
- const Type *T = MPT->getClass();
- if (T == nullptr)
- return;
- const CXXRecordDecl *RD = T->getAsCXXRecordDecl();
+ const CXXRecordDecl *RD = MPT->getMostRecentCXXRecordDecl();
if (RD == nullptr)
return;