CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConstCastAwayChecker.h
Go to the documentation of this file.
1 //== ConstCastAwayChecker.h - Checks for removed const qualfiers --------------*- C++ -*--==//
2 //
3 // Check in a generic way if an explicit cast removes a const qualifier.
4 //
5 // by Thomas Hauth [ Thomas.Hauth@cern.ch ]
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef Utilities_StaticAnalyzers_ConstCastAwayChecker_h
9 #define Utilities_StaticAnalyzers_ConstCastAwayChecker_h
10 
11 #include <clang/StaticAnalyzer/Core/Checker.h>
12 #include <clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h>
13 #include <clang/StaticAnalyzer/Core/BugReporter/BugType.h>
14 #include "CmsException.h"
15 
16 namespace clangcms {
17 
18 class ConstCastAwayChecker: public clang::ento::Checker< clang::ento::check::PreStmt< clang::ExplicitCastExpr> > {
19 public:
20  mutable std::unique_ptr<clang::ento::BugType> BT;
21  void checkPreStmt(const clang::ExplicitCastExpr *CE, clang::ento::CheckerContext &C) const;
22 
23 private:
25 
26 };
27 
28 }
29 
30 #endif
std::unique_ptr< clang::ento::BugType > BT
void checkPreStmt(const clang::ExplicitCastExpr *CE, clang::ento::CheckerContext &C) const