summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r--compilerplugins/clang/compat.hxx8
-rw-r--r--compilerplugins/clang/unusedmember.cxx2
2 files changed, 9 insertions, 1 deletions
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index cc3192ea9204..ac2a282c4fd8 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -250,6 +250,14 @@ inline bool isPureVirtual(clang::FunctionDecl const * decl) {
#endif
}
+inline bool isUnnamedBitField(clang::FieldDecl const * decl) {
+#if CLANG_VERSION >= 190000
+ return decl->isUnnamedBitField();
+#else
+ return decl->isUnnamedBitfield();
+#endif
+}
+
inline clang::TemplateTypeParmDecl const * getReplacedParameter(
clang::SubstTemplateTypeParmType const * type)
{
diff --git a/compilerplugins/clang/unusedmember.cxx b/compilerplugins/clang/unusedmember.cxx
index 305f9c606d31..610c94e162b3 100644
--- a/compilerplugins/clang/unusedmember.cxx
+++ b/compilerplugins/clang/unusedmember.cxx
@@ -155,7 +155,7 @@ public:
}
if (auto const d1 = dyn_cast<FieldDecl>(d))
{
- if (d1->isUnnamedBitfield())
+ if (compat::isUnnamedBitField(d1))
{
continue;
}