diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx index 97410fcbdc7a..bdbcdcb46f0b 100644 --- a/compilerplugins/clang/compat.hxx +++ b/compilerplugins/clang/compat.hxx @@ -240,6 +240,22 @@ inline const clang::Expr *getSubExprAsWritten(const clang::CastExpr *This) { return getSubExprAsWritten(const_cast(This)); } +inline bool isExplicitSpecified(clang::CXXConstructorDecl const * decl) { +#if CLANG_VERSION >= 80000 + return decl->getExplicitSpecifier().isExplicit(); +#else + return decl->isExplicitSpecified(); +#endif +} + +inline bool isExplicitSpecified(clang::CXXConversionDecl const * decl) { +#if CLANG_VERSION >= 80000 + return decl->getExplicitSpecifier().isExplicit(); +#else + return decl->isExplicitSpecified(); +#endif +} + } #endif diff --git a/compilerplugins/clang/salcall.cxx b/compilerplugins/clang/salcall.cxx index 883f099abc9a..ce32c46893ed 100644 --- a/compilerplugins/clang/salcall.cxx +++ b/compilerplugins/clang/salcall.cxx @@ -536,9 +536,9 @@ bool SalCall::isSalCallFunction(FunctionDecl const* functionDecl, SourceLocation if (noReturnType && !(functionDecl->isVirtualAsWritten() || (isa(functionDecl) - && cast(functionDecl)->isExplicitSpecified()) + && compat::isExplicitSpecified(cast(functionDecl))) || (isa(functionDecl) - && cast(functionDecl)->isExplicitSpecified()))) + && compat::isExplicitSpecified(cast(functionDecl))))) { SourceLocation endLoc1; if (macroStartLoc.isMacroID()