diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx index c9b2bc35b5f6..d04538e164b7 100644 --- a/compilerplugins/clang/compat.hxx +++ b/compilerplugins/clang/compat.hxx @@ -346,6 +346,12 @@ inline bool isPtrMemOp(clang::BinaryOperatorKind op) { #endif } +#if CLANG_VERSION >= 70000 +constexpr llvm::sys::fs::OpenFlags OF_None = llvm::sys::fs::OF_None; +#else +constexpr llvm::sys::fs::OpenFlags OF_None = llvm::sys::fs::F_None; +#endif + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index 315062969b25..35b5e03298b4 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -13,6 +13,7 @@ #include #include +#include "compat.hxx" #include "plugin.hxx" #include "pluginhandler.hxx" @@ -392,7 +393,7 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context ) bool bOk = false; std::error_code ec; std::unique_ptr ostream( - new raw_fd_ostream(filename, ec, sys::fs::F_None)); + new raw_fd_ostream(filename, ec, compat::OF_None)); if( !ec) { it->second.write( *ostream );