summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/compat.hxx9
-rw-r--r--compilerplugins/clang/cstylecast.cxx2
2 files changed, 10 insertions, 1 deletions
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index a836aa0af1ed..650d187070e0 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -82,6 +82,15 @@ constexpr clang::ExprValueKind VK_PRValue = clang::VK_PRValue;
constexpr clang::ExprValueKind VK_PRValue = clang::VK_RValue;
#endif
+namespace ElabortatedTypeKeyword
+{
+#if CLANG_VERSION >= 180000
+constexpr clang::ElaboratedTypeKeyword None = clang::ElaboratedTypeKeyword::None;
+#else
+constexpr clang::ElaboratedTypeKeyword None = clang::ETK_None;
+#endif
+}
+
inline bool EvaluateAsInt(clang::Expr const * expr, llvm::APSInt& intRes, const clang::ASTContext& ctx) {
clang::Expr::EvalResult res;
bool b = expr->EvaluateAsInt(res, ctx);
diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx
index 35292ecd8fb6..2360606aff55 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -161,7 +161,7 @@ bool canBeUsedForFunctionalCast(TypeSourceInfo const * info) {
return true;
}
if (auto const t = dyn_cast<ElaboratedType>(type)) {
- return t->getKeyword() == ETK_None;
+ return t->getKeyword() == compat::ElabortatedTypeKeyword::None;
}
return false;
}