Debian Codegraph @

src/checks/level2/implicit-casts.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 Sergio Martins <[email protected]>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9
10 #ifndef CLANG_LAZY_IMPLICIT_CASTS_H
11 #define CLANG_LAZY_IMPLICIT_CASTS_H
12
13 #include "checkbase.h"
14
15 #include <string>
16
17 namespace clang
18 {
19 class SourceLocation;
20 class FunctionDecl;
21 }
22
23 /**
24 * Finds places with unwanted implicit casts.
25 *
26 * See README-implicit-casts for more information
27 */
28 class ImplicitCasts : public CheckBase
29 {
30 public:
31 ImplicitCasts(const std::string &name, Options options);
32 void VisitStmt(clang::Stmt *stmt) override;
33
34 private:
35 bool isBoolToInt(clang::FunctionDecl *func) const;
36 bool isMacroToIgnore(clang::SourceLocation loc) const;
37 };
38
39 #endif