CMS 3D CMS Logo

CatchAll.h
Go to the documentation of this file.
1 //==-- CatchAll.h - Checks for catch(...) in source files --------------*- C++ -*--==//
2 //
3 // by Shahzad Malik MUZAFFAR [ Shahzad.Malik.MUZAFFAR@cern.ch ]
4 //
5 //===----------------------------------------------------------------------===//
6 #ifndef Utilities_StaticAnalyzers_CatchAll_h
7 #define Utilities_StaticAnalyzers_CatchAll_h
8 
9 #include <clang/StaticAnalyzer/Core/Checker.h>
10 #include <clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h>
11 #include <clang/AST/StmtCXX.h>
12 
13 namespace clangcms {
14  class CatchAll : public clang::ento::Checker<clang::ento::check::ASTCodeBody> {
15  public:
16  void checkASTCodeBody(const clang::Decl* D, clang::ento::AnalysisManager&, clang::ento::BugReporter& BR) const;
17 
18  private:
19  const clang::Stmt* process(const clang::Stmt* S) const;
20  inline bool checkCatchAll(const clang::CXXCatchStmt* S) const { return S->getCaughtType().isNull(); }
21  };
22 } // namespace clangcms
23 #endif
const clang::Stmt * process(const clang::Stmt *S) const
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
bool checkCatchAll(const clang::CXXCatchStmt *S) const
Definition: CatchAll.h:20
void checkASTCodeBody(const clang::Decl *D, clang::ento::AnalysisManager &, clang::ento::BugReporter &BR) const