diff --git a/compilerplugins/clang/includeform.cxx b/compilerplugins/clang/includeform.cxx index d9e603351783..7b2c0feb07ea 100644 --- a/compilerplugins/clang/includeform.cxx +++ b/compilerplugins/clang/includeform.cxx @@ -28,13 +28,18 @@ private: void InclusionDirective( SourceLocation HashLoc, Token const & IncludeTok, StringRef, - bool IsAngled, CharSourceRange FilenameRange, FileEntry const * File, + bool IsAngled, CharSourceRange FilenameRange, +#if CLANG_VERSION >= 150000 + Optional File, +#else + FileEntry const * File, +#endif StringRef SearchPath, StringRef, clang::Module const *, SrcMgr::CharacteristicKind) override { if (ignoreLocation(HashLoc)) { return; } - if (File == nullptr) { // in case of "fatal error: '...' file not found" + if (!File) { // in case of "fatal error: '...' file not found" return; } if (IncludeTok.getIdentifierInfo()->getPPKeywordID() != tok::pp_include)