CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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>,
16  clang::ento::check::ASTDecl<clang::UsingDecl> > {
17  public:
18  void checkASTDecl(const clang::UsingDirectiveDecl *D,
19  clang::ento::AnalysisManager &Mgr,
20  clang::ento::BugReporter &BR) const;
21  void checkASTDecl(const clang::UsingDecl *D, clang::ento::AnalysisManager &Mgr, clang::ento::BugReporter &BR) const;
22 
23  private:
24  bool isDeclOK(const clang::NamedDecl *D, clang::ento::BugReporter &BR) const;
25  void reportBug(const char *bug, const clang::Decl *D, clang::ento::BugReporter &BR) const;
26  };
27 } // namespace clangcms
28 #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:141