File indexing completed on 2024-04-28 05:38:29
0001 /* 0002 SPDX-FileCopyrightText: 2015 Sergio Martins <smartins@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef CLANG_LAZY_RULE_OF_TWO_SOFT_H 0008 #define CLANG_LAZY_RULE_OF_TWO_SOFT_H 0009 0010 #include "checks/ruleofbase.h" 0011 0012 #include <string> 0013 0014 class ClazyContext; 0015 0016 namespace clang 0017 { 0018 class Stmt; 0019 } 0020 0021 /** 0022 * Finds classes or structs which violate the rule of two. 0023 * If a class has a copy-ctor it should have copy-assignment operator too, and vice-versa. 0024 * 0025 * See README-rule-of-two-soft for more information 0026 */ 0027 class RuleOfTwoSoft : public RuleOfBase 0028 { 0029 public: 0030 explicit RuleOfTwoSoft(const std::string &name, ClazyContext *context); 0031 void VisitStmt(clang::Stmt *s) override; 0032 }; 0033 0034 #endif