[clang] #101784 part 1: introduce ctyped in an independent manner (PR #101941)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 8 14:16:45 PDT 2024


Endilll wrote:

> Good point about the restype for clang_Cursor_getTemplateArgumentKind though, I didn't notice and we should probably change that

Yes, I'd like us to stop relying on that for the same reason I don't like `errcheck`. The fact that it's deprecated further adds to it.

> I don't quite get what 17 meant. As far as I know about ctypes, conf.lib.clang_getRangeStart should be guaranteed to return an instance of SourceLocation. If it is to extinguish type errors, typing.cast(SourceLocation, conf.lib.clang_getRangeStart(self)) can do this.

Yes, 17 is about type errors when a structural type is returned. Good point about `typing.cast()`. It's been long enough I forgot that it exists. It might be the best way to address type errors in this case.

https://github.com/llvm/llvm-project/pull/101941


More information about the cfe-commits mailing list