CMS 3D CMS Logo

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>
15 #include "CmsException.h"
16 
17 namespace clangcms {
18 
19  class ConstCastAwayChecker : public clang::ento::Checker<clang::ento::check::PreStmt<clang::ExplicitCastExpr> > {
20  public:
21  CMS_SA_ALLOW mutable std::unique_ptr<clang::ento::BugType> BT;
22  void checkPreStmt(const clang::ExplicitCastExpr *CE, clang::ento::CheckerContext &C) const;
23 
24  private:
26  };
27 
28 } // namespace clangcms
29 
30 #endif
clangcms::ConstCastAwayChecker::m_exception
CmsException m_exception
Definition: ConstCastAwayChecker.h:25
clangcms::CmsException
Definition: CmsException.h:19
clangcms
Definition: ArgSizeChecker.h:10
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
clangcms::ConstCastAwayChecker::BT
std::unique_ptr< clang::ento::BugType > BT
Definition: ConstCastAwayChecker.h:21
clangcms::ConstCastAwayChecker
Definition: ConstCastAwayChecker.h:19
thread_safety_macros.h
clangcms::ConstCastAwayChecker::checkPreStmt
void checkPreStmt(const clang::ExplicitCastExpr *CE, clang::ento::CheckerContext &C) const
CmsException.h
gen::C
C
Definition: PomwigHadronizer.cc:76