[clang] [libclang/python] Fix numResults field type of CCRStructure (PR #158598)

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 15 03:36:49 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jannick Kremer (DeinAlptraum)

<details>
<summary>Changes</summary>

Fix the type of the `numResults` field of `CCRStructure`, as pointed out here: https://github.com/llvm/llvm-project/pull/140539#discussion_r2317808734

---
Full diff: https://github.com/llvm/llvm-project/pull/158598.diff


1 Files Affected:

- (modified) clang/bindings/python/clang/cindex.py (+1-1) 


``````````diff
diff --git a/clang/bindings/python/clang/cindex.py b/clang/bindings/python/clang/cindex.py
index 3398823836e62..071bd76f95906 100644
--- a/clang/bindings/python/clang/cindex.py
+++ b/clang/bindings/python/clang/cindex.py
@@ -3150,7 +3150,7 @@ def string(self) -> CompletionString:
 
 
 class CCRStructure(Structure):
-    _fields_ = [("results", POINTER(CodeCompletionResult)), ("numResults", c_int)]
+    _fields_ = [("results", POINTER(CodeCompletionResult)), ("numResults", c_uint)]
 
     results: NoSliceSequence[CodeCompletionResult]
     numResults: int

``````````

</details>


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


More information about the cfe-commits mailing list