aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Lohnau <alexander.lohnau@gmx.de>2024-02-05 13:34:00 +0100
committerAlexander Lohnau <alexander.lohnau@gmx.de>2024-02-11 14:29:51 +0100
commitc73cab4f692bdef4ecfef3524965d56e29b478d7 (patch)
tree83d3adda5d8d781d1cab17742919daa6a0145ef0
parentb02b46a5eec460753d4a83a78a53d5b15aa48d76 (diff)
Remove clazy::isFinal compat helper
-rw-r--r--src/SourceCompatibilityHelpers.h9
-rw-r--r--src/checks/level2/copyable-polymorphic.cpp2
2 files changed, 1 insertions, 10 deletions
diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
index 686d30b1..d02c06e8 100644
--- a/src/SourceCompatibilityHelpers.h
+++ b/src/SourceCompatibilityHelpers.h
@@ -88,15 +88,6 @@ inline auto getBuffer(const clang::SourceManager &sm, clang::FileID id, bool *in
#define GET_LEXER(id, inputFile, sm, lo) clang::Lexer(id, inputFile, sm, lo)
#endif
-inline bool isFinal(const clang::CXXRecordDecl *record)
-{
-#if LLVM_VERSION_MAJOR >= 11
- return record->isEffectivelyFinal();
-#else
- return record->hasAttr<clang::FinalAttr>();
-#endif
-}
-
inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
{
#if LLVM_VERSION_MAJOR >= 13
diff --git a/src/checks/level2/copyable-polymorphic.cpp b/src/checks/level2/copyable-polymorphic.cpp
index 6d499b9b..89ae1b92 100644
--- a/src/checks/level2/copyable-polymorphic.cpp
+++ b/src/checks/level2/copyable-polymorphic.cpp
@@ -80,7 +80,7 @@ void CopyablePolymorphic::VisitDecl(clang::Decl *decl)
return;
}
- if (clazy::isFinal(record) && !hasPublicCopyInAncestors(record)) {
+ if (record->isEffectivelyFinal() && !hasPublicCopyInAncestors(record)) {
// If the derived class is final, and all the base classes copy-ctors are protected or private then it's ok
return;
}