CMS 3D CMS Logo

UsingNamespace.h
Go to the documentation of this file.
1 //==-- UsingNamespace.h - Checks for using namespace and using std:: in headers --------------*- C++ -*--==//
2 //
3 // by Shahzad Malik MUZAFFAR [ Shahzad.Malik.MUZAFFAR@cern.ch ]
4 //
5 //===----------------------------------------------------------------------===//
6 #ifndef Utilities_StaticAnalyzers_UsingNamespace_h
7 #define Utilities_StaticAnalyzers_UsingNamespace_h
8 
9 #include <clang/StaticAnalyzer/Core/Checker.h>
10 #include <clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h>
11 #include <clang/AST/DeclCXX.h>
12 #include <llvm/Support/raw_ostream.h>
13 
14 namespace clangcms {
15  class UsingNamespace : public clang::ento::Checker< clang::ento::check::ASTDecl <clang::UsingDirectiveDecl>,clang::ento::check::ASTDecl <clang::UsingDecl> >
16  {
17  public:
18  void checkASTDecl (const clang::UsingDirectiveDecl *D, clang::ento::AnalysisManager &Mgr, clang::ento::BugReporter &BR) const;
19  void checkASTDecl (const clang::UsingDecl *D, clang::ento::AnalysisManager &Mgr, clang::ento::BugReporter &BR) const;
20  private:
21  bool isDeclOK(const clang::NamedDecl *D, clang::ento::BugReporter &BR) const;
22  void reportBug(const char* bug, const clang::Decl *D, clang::ento::BugReporter &BR) const;
23  };
24 }
25 #endif
void reportBug(const char *bug, const clang::Decl *D, clang::ento::BugReporter &BR) const
bool isDeclOK(const clang::NamedDecl *D, clang::ento::BugReporter &BR) const
void checkASTDecl(const clang::UsingDirectiveDecl *D, clang::ento::AnalysisManager &Mgr, clang::ento::BugReporter &BR) const
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150