Skip to content

Fix handling ElaboratedType and TypeWithKeyword instances of id/SEL/Class. - #663

Merged
tannergooding merged 3 commits into
dotnet:mainfrom
rolfbjarne:special-objc-cxtype
Jan 5, 2026
Merged

Fix handling ElaboratedType and TypeWithKeyword instances of id/SEL/Class.#663
tannergooding merged 3 commits into
dotnet:mainfrom
rolfbjarne:special-objc-cxtype

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Due to this code:

https://github.com/llvm/llvm-project/blob/393783fff844d8919a090f74e641d78c50bcc7f4/clang/tools/libclang/CXType.cpp#L154-L162

an ElaboratedType or TypeWithKeyword can actually have a type of
CXType_ObjCClass, CXType_ObjCId, or CXType_ObjCSel, so handle this case.

@rolfbjarne

Copy link
Copy Markdown
Member Author

This is probably not the best way to solve this issue, because I would think other types than 'ElaboratedType' and 'TypeWithKeyword' would run into this, but this solution works when parsing all of the frameworks Apple ships with Xcode for iOS, macOS, tvOS and Mac Catalyst.

…lass.

Due to this code:

https://github.com/llvm/llvm-project/blob/393783fff844d8919a090f74e641d78c50bcc7f4/clang/tools/libclang/CXType.cpp#L154-L162

an ElaboratedType or TypeWithKeyword can actually have a type of
CXType_ObjCClass, CXType_ObjCId, or CXType_ObjCSel, so handle this case.
@rolfbjarne
rolfbjarne force-pushed the special-objc-cxtype branch from c83ae67 to d626bf9 Compare January 5, 2026 10:38
Comment thread sources/ClangSharp/Types/Type.cs Outdated
Comment thread sources/ClangSharp/Types/TypeWithKeyword.cs Outdated
@tannergooding
tannergooding merged commit b27574f into dotnet:main Jan 5, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants