/* 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_TEMPORARIES_H #define DETACHING_TEMPORARIES_H #include "checks/detachingbase.h" #include #include #include #include /** * Finds places where you're calling non-const member functions on temporaries. * * For example getList().first(), which would detach if the container is shared. * See README-deatching-temporary for more information */ class DetachingTemporary : public DetachingBase { public: DetachingTemporary(const std::string &name, Options options); void VisitStmt(clang::Stmt *stm) override; private: bool isDetachingMethod(clang::CXXMethodDecl *method) const; std::map> m_writeMethodsByType; }; #endif