Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:49

0001 //==-- CatchAll.h - Checks for catch(...) in source files --------------*- C++ -*--==//
0002 //
0003 // by Shahzad Malik MUZAFFAR [ Shahzad.Malik.MUZAFFAR@cern.ch ]
0004 //
0005 //===----------------------------------------------------------------------===//
0006 #ifndef Utilities_StaticAnalyzers_CatchAll_h
0007 #define Utilities_StaticAnalyzers_CatchAll_h
0008 
0009 #include <clang/StaticAnalyzer/Core/Checker.h>
0010 #include <clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h>
0011 #include <clang/AST/StmtCXX.h>
0012 
0013 namespace clangcms {
0014   class CatchAll : public clang::ento::Checker<clang::ento::check::ASTCodeBody> {
0015   public:
0016     void checkASTCodeBody(const clang::Decl* D, clang::ento::AnalysisManager&, clang::ento::BugReporter& BR) const;
0017 
0018   private:
0019     const clang::Stmt* process(const clang::Stmt* S) const;
0020     inline bool checkCatchAll(const clang::CXXCatchStmt* S) const { return S->getCaughtType().isNull(); }
0021   };
0022 }  // namespace clangcms
0023 #endif