From c73cab4f692bdef4ecfef3524965d56e29b478d7 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Mon, 5 Feb 2024 13:34:00 +0100 Subject: Remove clazy::isFinal compat helper --- src/SourceCompatibilityHelpers.h | 9 --------- src/checks/level2/copyable-polymorphic.cpp | 2 +- 2 files changed, 1 insertion(+), 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(); -#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; } -- cgit v1.2.3