aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-10-12 09:33:53 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-12 13:54:23 +0000
commitd49ab9644f0881b43035b528ed3e1099b839fa32 (patch)
treed52be842e05045c84ab9c5f2915af98b4e3f04c1
parent4788127dca1f90c0a83cbf3016da708404eaad69 (diff)
shiboken6: Adapt to LLVM 12.01
The identifier for anonymous enums has been changed, causing shiboken to no longer recognize them. Task-number: PYSIDE-1686 Change-Id: I4d463132b8bd3fffa0b57f03be6c58ecbae94a49 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 1948a1b6f9a3547ba9fba9b8c525eb6e1c6b4f13) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
index f583aba99..9e902a311 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
@@ -919,8 +919,10 @@ static QString enumType(const CXCursor &cursor)
// PYSIDE-1228: For "typedef enum { v1, v2 } Foo;", type will return
// "Foo" as expected. Care must be taken to exclude real anonymous enums.
name = getTypeName(clang_getCursorType(cursor));
- if (name.contains(QLatin1String("(anonymous")))
+ if (name.contains(u"(unnamed") // Clang 12.0.1
+ || name.contains(u"(anonymous")) { // earlier
name.clear();
+ }
}
return name;
}