/* SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB a KDAB Group company info@kdab.com SPDX-FileContributor: Sérgio Martins SPDX-FileCopyrightText: 2015 Sergio Martins SPDX-License-Identifier: LGPL-2.0-or-later */ #ifndef DETACHING_BASE_H #define DETACHING_BASE_H #include "checkbase.h" #include namespace clang { class CXXMethodDecl; } /** * Base class for checks that look for detachments. */ class DetachingBase : public CheckBase { public: explicit DetachingBase(const std::string &name, Options = Option_None); protected: enum DetachingMethodType { DetachingMethod, DetachingMethodWithConstCounterPart }; std::vector getFixitHints(llvm::StringRef className, llvm::StringRef functionName, clang::CallExpr *callExpr) const; bool isDetachingMethod(clang::CXXMethodDecl *, DetachingMethodType = DetachingMethod) const; }; #endif