diff --git a/checks/oldstyleconnect.cpp b/checks/oldstyleconnect.cpp index 69c318a1..75821471 100644 --- a/checks/oldstyleconnect.cpp +++ b/checks/oldstyleconnect.cpp @@ -65,6 +65,7 @@ enum ConnectFlag { }; +#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 6 class PreprocessorCallbacks : public clang::PPCallbacks { public: @@ -99,13 +100,16 @@ class PreprocessorCallbacks : public clang::PPCallbacks SourceManager *m_sm; LangOptions m_langOpts; }; +#endif OldStyleConnect::OldStyleConnect(const std::string &name) : CheckBase(name) { +#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 6 m_preprocessorCallbacks = new PreprocessorCallbacks(this, &m_ci.getSourceManager(), m_ci.getLangOpts()); Preprocessor &pi = m_ci.getPreprocessor(); pi.addPPCallbacks(std::unique_ptr(m_preprocessorCallbacks)); +#endif } int OldStyleConnect::classifyConnect(FunctionDecl *connectFunc, CallExpr *connectCall)