Debian Codegraph @

src/checks/level2/missing-typeinfo.h

raw
1 /*
2 SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB a KDAB Group company [email protected]
3 SPDX-FileContributor: Sérgio Martins <[email protected]>
4
5 SPDX-FileCopyrightText: 2015-2016 Sergio Martins <[email protected]>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9
10 #ifndef CLAZY_MISSING_TYPE_INFO_H
11 #define CLAZY_MISSING_TYPE_INFO_H
12
13 #include "checkbase.h"
14
15 #include <set>
16 #include <string>
17
18 namespace clang
19 {
20 class ClassTemplateSpecializationDecl;
21 class QualType;
22 }
23
24 /**
25 * Suggests usage of Q_PRIMITIVE_TYPE or Q_MOVABLE_TYPE in cases where you're using QList<T> and sizeof(T) > sizeof(void*)
26 * or using QVector<T>. Unless they already have a classification.
27 *
28 * See README-missing-type-info for more info.
29 */
30 class MissingTypeInfo : public CheckBase
31 {
32 public:
33 using CheckBase::CheckBase;
34 void VisitDecl(clang::Decl *decl) override;
35
36 private:
37 void registerQTypeInfo(clang::ClassTemplateSpecializationDecl *decl);
38 bool typeHasClassification(clang::QualType) const;
39 std::set<std::string> m_typeInfos;
40 };
41
42 #endif