diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-04-11 14:38:01 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-04-12 14:11:57 +0200 |
| commit | e20e1ea0f5f9f9a0fe1c309a60cb5297f1276efc (patch) | |
| tree | b4a68513dc85ab6d7fc6302d3d08c9c068ff0bdc /sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp | |
| parent | 15b964d00b85ec0175214ace7c06a560447bf1b5 (diff) | |
shiboken6: Fix build with clang 16
getCursorSpelling() reports a name for unnamed enums.
Pick-to: 6.5 6.2 5.15
Task-number: PYSIDE-2288
Change-Id: Iaeb6409c8825dc0fb2720b450fb14e64bbf5d303
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp index dce28f301..d5009e54f 100644 --- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp +++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp @@ -903,6 +903,8 @@ static NamespaceType namespaceType(const CXCursor &cursor) static QString enumType(const CXCursor &cursor) { QString name = getCursorSpelling(cursor); // "enum Foo { v1, v2 };" + if (name.contains(u"unnamed enum")) // Clang 16.0 + return {}; if (name.isEmpty()) { // PYSIDE-1228: For "typedef enum { v1, v2 } Foo;", type will return // "Foo" as expected. Care must be taken to exclude real anonymous enums. |
