summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2024-03-08 13:40:55 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-09 11:52:11 +0000
commita916ac4087b1a0ec76b7fb5b3c003274d685716d (patch)
treef72a88b36f63a120fab54f1b57d0497884c15415
parent66bed97bfd33875e8412cba5ea6a41b69a83365a (diff)
QDoc: Adapt clang/AST/QualTypeNames.h to upstream change
QDoc maintains a slightly modified version of the Clang header `QualTypeNames.h`. Due to an upstream change [0] that changes an enum into an enum class and renames a value that's used in the aforementioned header, QDoc fails to compile against Clang 18. This patch introduces a preprocessor conditional check for the major version of `libclang` and defines the old symbol name if Clang is of a version where the symbol has been renamed. [0] - https://github.com/llvm/llvm-project/commit/4ad2ada5216ee2bb3c334a3233a9ab51f2521b82 Fixes: QTBUG-123109 Change-Id: I0fa916a201d963c5f23d87d73105b23fe55719ea Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> (cherry picked from commit 8c5e3f46e2fa5056280220c3b0a74025098e2be3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qdoc/qdoc/src/qdoc/clang/AST/QualTypeNames.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qdoc/qdoc/src/qdoc/clang/AST/QualTypeNames.h b/src/qdoc/qdoc/src/qdoc/clang/AST/QualTypeNames.h
index baf7ceebb..c6d331ea8 100644
--- a/src/qdoc/qdoc/src/qdoc/clang/AST/QualTypeNames.h
+++ b/src/qdoc/qdoc/src/qdoc/clang/AST/QualTypeNames.h
@@ -438,6 +438,9 @@ inline QualType getFullyQualifiedType(QualType QT, const ASTContext &Ctx,
// elaborated type.
Qualifiers PrefixQualifiers = QT.getLocalQualifiers();
QT = QualType(QT.getTypePtr(), 0);
+#if LIBCLANG_VERSION_MAJOR >= 18
+ constexpr ElaboratedTypeKeyword ETK_None = ElaboratedTypeKeyword::None;
+#endif
ElaboratedTypeKeyword Keyword = ETK_None;
if (const auto *ETypeInput = dyn_cast<ElaboratedType>(QT.getTypePtr())) {
QT = ETypeInput->getNamedType();