[clang] [Clang][NFC] Add test for CWG2285 "Issues with structured bindings" (PR #126421)

2025-02-24 Thread Vlad Serebrennikov via cfe-commits
@@ -196,6 +196,16 @@ void g() { #endif } // namespace cwg2277 +namespace cwg2285 { // cwg2285: 4 Endilll wrote: You're right, Clang 4 behaves as expected without `#if __cplusplus`. > Do I need to add this note in test file? Yes, leave a comment somewhere th

[clang] [Clang] Implement CWG2918 'Consideration of constraints for address of overloaded function' (PR #127773)

2025-02-20 Thread Vlad Serebrennikov via cfe-commits
@@ -60,6 +60,92 @@ struct S { #endif } // namespace cwg2917 +namespace cwg2918 { // cwg2918: 21 + +#if __cplusplus >= 202002L + +namespace Example1 { + +template struct X { + void f(short) requires B; + void f(long); + template void g(short) requires B; + template void g(l

[clang] [TBAA] Refine pointer-tbaa for void pointers by pointer depth (PR #126047)

2025-02-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/126047 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Remove duplicate API (PR #132776)

2025-03-31 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll requested changes to this pull request. libclang's API is called stable for a reason. It's too late to remove anything. The best we can do is to implement one function in terms of another to avoid duplication on implementation side, and put `[[deprecated("use the othe

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-04-04 Thread Vlad Serebrennikov via cfe-commits
@@ -444,6 +444,7 @@ Python Binding Changes -- - Added ``Type.get_methods``, a binding for ``clang_visitCXXMethods``, which allows visiting the methods of a class. +- Add equality comparison operators for ``File`` type Endilll wrote: ```su

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Vlad Serebrennikov via cfe-commits
@@ -16,3 +17,30 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Vlad Serebrennikov via cfe-commits
@@ -16,3 +17,16 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(kInputsDir, "hello.cpp") +header_path = os.

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-21 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: @AaronBallman do you have a clue why equality comparison for in-memory files works differently compared to on-disk files? https://github.com/llvm/llvm-project/pull/130383 ___ cfe-commits mailing list cfe-commits@l

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-22 Thread Vlad Serebrennikov via cfe-commits
@@ -16,3 +17,30 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(inputs_dir, "hello.cpp") +header_path = os.

[clang] [clang] Update C++ DR status page (PR #131812)

2025-03-19 Thread Vlad Serebrennikov via cfe-commits
@@ -3599,7 +3599,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/591.html";>591 CD4 When a dependent base class is the current instantiation -Clang 20 +Clang 20 Endilll wrote: This is caused by the fact

[clang] [libclang/python] Add equality comparison operators for File (PR #130383)

2025-03-20 Thread Vlad Serebrennikov via cfe-commits
@@ -16,3 +17,16 @@ def test_file(self): self.assertEqual(str(file), "t.c") self.assertEqual(file.name, "t.c") self.assertEqual(repr(file), "") + +def test_file_eq(self): +path = os.path.join(kInputsDir, "hello.cpp") +header_path = os.

[clang] [clang] Fix overload resolution ranking of inherited constructors (PR #132830)

2025-03-25 Thread Vlad Serebrennikov via cfe-commits
@@ -169,6 +169,20 @@ B b; // since-cxx11-error@-1 {{call to implicitly-deleted default constructor of 'B'}} // since-cxx11-note@#cwg2273-B {{default constructor of 'B' is implicitly deleted because base class 'A' has a deleted default constructor}} // since-cxx11-note@#cw

[clang] [clang] Fix overload resolution ranking of inherited constructors (PR #132830)

2025-03-28 Thread Vlad Serebrennikov via cfe-commits
@@ -169,6 +169,20 @@ B b; // since-cxx11-error@-1 {{call to implicitly-deleted default constructor of 'B'}} // since-cxx11-note@#cwg2273-B {{default constructor of 'B' is implicitly deleted because base class 'A' has a deleted default constructor}} // since-cxx11-note@#cw

[clang] [clang] Fix overload resolution ranking of inherited constructors (PR #132830)

2025-03-25 Thread Vlad Serebrennikov via cfe-commits
@@ -169,6 +169,20 @@ B b; // since-cxx11-error@-1 {{call to implicitly-deleted default constructor of 'B'}} // since-cxx11-note@#cwg2273-B {{default constructor of 'B' is implicitly deleted because base class 'A' has a deleted default constructor}} // since-cxx11-note@#cw

[clang] [clang] Fix overload resolution ranking of inherited constructors (PR #132830)

2025-03-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/132830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement CWG2517 Useless restriction on use of parameter in constraint-expression (PR #132919)

2025-03-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: If you update your branch with changes from `main`, unrelated changes in `cxx_dr_status.html` will disappear. https://github.com/llvm/llvm-project/pull/132919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [clang] Fix overload resolution ranking of inherited constructors (PR #132830)

2025-03-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: CWG2273 says that its resolution fixed [CWG2277](https://cplusplus.github.io/CWG/issues/2277.html). Can you look into that, too? Maybe we can claim conformance with one more Core issue for free. https://github.com/llvm/llvm-project/pull/132830

[clang] [clang] Fix overload resolution ranking of inherited constructors (PR #132830)

2025-03-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/132830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 5159911 - [clang][NFC] Update C++ DR status page

2025-03-25 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-03-25T19:21:09+04:00 New Revision: 5159911a7c1476ff182363068d2a1169286bfb06 URL: https://github.com/llvm/llvm-project/commit/5159911a7c1476ff182363068d2a1169286bfb06 DIFF: https://github.com/llvm/llvm-project/commit/5159911a7c1476ff182363068d2a1169286bfb06.

[clang] [clang] Fix overload resolution ranking of inherited constructors (PR #132830)

2025-03-25 Thread Vlad Serebrennikov via cfe-commits
@@ -169,6 +169,20 @@ B b; // since-cxx11-error@-1 {{call to implicitly-deleted default constructor of 'B'}} // since-cxx11-note@#cwg2273-B {{default constructor of 'B' is implicitly deleted because base class 'A' has a deleted default constructor}} // since-cxx11-note@#cw

[clang] [clang] Implement CWG2803 and CWG2958 (PR #132779)

2025-04-04 Thread Vlad Serebrennikov via cfe-commits
@@ -6,6 +6,89 @@ // RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected,since-cxx11,cxx11-23,since-cxx20,since-cxx23 %s // RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected,since-cxx11,since-cxx20,since-cxx23,since-cxx26 %s +namespace cwg2803 { // cwg2803

[clang] [clang-tools-extra] Suppress pedantic diagnostic for a file not ending in EOL (PR #131794)

2025-04-04 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -triple

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-07 Thread Vlad Serebrennikov via cfe-commits
@@ -1913,7 +1916,7 @@ def type(self): return self._type @property -def canonical(self): +def canonical(self) -> Cursor | None: """Return the canonical Cursor corresponding to this Cursor. Endilll wrote: > That said, the input to i

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-07 Thread Vlad Serebrennikov via cfe-commits
@@ -1821,45 +1824,45 @@ def mangled_name(self): return self._mangled_name @property -def location(self): +def location(self) -> SourceLocation: """ Return the source location (the starting character) of the entity pointed at by th

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-07 Thread Vlad Serebrennikov via cfe-commits
@@ -59,8 +59,8 @@ Parser::Parser(Preprocessor &pp, Sema &actions, bool skipFunctionBodies) PreferredType(&actions.getASTContext(), pp.isCodeCompletionEnabled()), Actions(actions), Diags(PP.getDiagnostics()), StackHandler(Diags), GreaterThanIsOperator(true), C

[clang] [Clang][RFC] Do not eat SFINAE diagnostics for explicit template arguments (PR #139066)

2025-05-08 Thread Vlad Serebrennikov via cfe-commits
@@ -985,7 +985,9 @@ namespace cwg354 { // cwg354: 3.1 c++11 int b1 = both<(int*)0>(); // cxx98-error@-1 {{no matching function for call to 'both'}} // cxx98-note@#cwg354-both-int-ptr {{candidate template ignored: invalid explicitly-specified argument for 1st template p

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-12 Thread Vlad Serebrennikov via cfe-commits
@@ -1821,45 +1824,45 @@ def mangled_name(self): return self._mangled_name @property -def location(self): +def location(self) -> SourceLocation: """ Return the source location (the starting character) of the entity pointed at by th

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void f(void) { + int_val2 = 0; // expected-error{{use of undeclared identifier}} + sin(0); // expected-error{{use of undeclared identifier 'sin'}} \ + // expected-note{{perhaps `#include ` is needed?}} + +

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -1489,6 +1490,7 @@ namespace cwg387 { // cwg387: 2.8 a = gcd(a, b); b = gcd(3, 4); // expected-error@-1 {{use of undeclared identifier 'gcd'}} + // expected-note@-2 {{perhaps `#include ` is needed?}} Endilll wrote: ```suggestion

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -26,14 +26,18 @@ void no_get_1() { auto [a0, a1] = A(); // expected-error {{decomposes into 3 elements}} auto [b0, b1] = B(); // expected-error {{decomposes into 3 elements}} } - auto [a0, a1, a2] = A(); // expected-error {{undeclared identifier 'get'}} expected-

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void f(void) { + int_val2 = 0; // expected-error{{use of undeclared identifier}} + sin(0); // expected-error{{use of undeclared identifier 'sin'}} \ + // expected-note{{perhaps `#include ` is needed?}} + +

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -1474,6 +1474,7 @@ namespace cwg387 { // cwg387: 2.8 a = gcd(a, b); b = gcd(3, 4); // expected-error@-1 {{use of undeclared identifier 'gcd'}} + // expected-note@-2 {{perhaps `#include ` is needed?}} Endilll wrote: ```suggestion

[clang] [Clang] suggest headers on undeclared errors (#120388) (PR #140247)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: You should put "Fixes #120388" in the description, and remove the issue number from the title, because it will be confusing after merging, when number of this PR will be added to the title. https://github.com/llvm/llvm-project/pull/140247 ___

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-13 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Numbers for clang-format uncleanliness of `Parser.h` with changes from this PR: `92 insertions(+), 87 deletions(-)` (all in grammar productions). https://github.com/llvm/llvm-project/pull/138511 ___ cfe-commits mailing list cfe-commits@

[clang] d441d28 - [clang][NFC] Fix indentation in a comment

2025-05-14 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-05-14T11:43:21+03:00 New Revision: d441d28083e2f9de5170f5a96a8e44a38d306c62 URL: https://github.com/llvm/llvm-project/commit/d441d28083e2f9de5170f5a96a8e44a38d306c62 DIFF: https://github.com/llvm/llvm-project/commit/d441d28083e2f9de5170f5a96a8e44a38d306c62.

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -1821,45 +1824,45 @@ def mangled_name(self): return self._mangled_name @property -def location(self): +def location(self) -> SourceLocation: """ Return the source location (the starting character) of the entity pointed at by th

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-14 Thread Vlad Serebrennikov via cfe-commits
@@ -1552,68 +1553,85 @@ class Cursor(Structure): _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)] +_tu: TranslationUnit + +# This ensures that no operations are possible on null cursors +# by guarding all method calls with a not-null

[clang] [clang][NFC] Regroup declarations in `Parser` (PR #138511)

2025-05-13 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/138511 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Revert "[clang] Add scoped enum support to `StreamingDiagnostic`" (PR #138139)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/138139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Type class (PR #140378)

2025-05-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Our error-handling story is bad and inconsistent, but that's out of scope of this PR https://github.com/llvm/llvm-project/pull/140378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [libclang/python] Add typing annotations for the Type class (PR #140378)

2025-05-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/140378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Type class (PR #140378)

2025-05-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/140378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Type class (PR #140378)

2025-05-18 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > LLVM Buildbot has detected a new failure on builder `clang-s390x-linux-lnt` > running on `systemz-1` while building `clang` at step 13 "setup lit". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/136/builds/3945 > Here is the relevant piece of the

[clang] [libclang/python] Add typing annotations for the Type class (PR #140378)

2025-05-18 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > LLVM Buildbot has detected a new failure on builder `clang-s390x-linux-lnt` > running on `systemz-1` while building `clang` at step 13 "setup lit". > > Full details are available at: > https://lab.llvm.org/buildbot/#/builders/136/builds/3945 > Here is the relevant piece of the

[clang] [libclang/python] Add `Cursor.from_translation_unit` (PR #140496)

2025-05-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/140496 This should complete the list of things `Cursor` can be made from. >From 2fa8240df89d195c25da9d0ee52101830ae41677 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 19 May 2025 09:20:55 +0300 Subject:

[clang] [libclang/python] Add `Cursor.from_translation_unit` (PR #140496)

2025-05-18 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Hmm, so the reason we have `Cursor.from_source_location` is that SourceLocation doesn't hold a reference to TU. Yeah, I guess we don't need this. https://github.com/llvm/llvm-project/pull/140496 ___ cfe-commits mailing list cfe-commits@

[clang] [libclang/python] Add `Cursor.from_translation_unit` (PR #140496)

2025-05-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/140496 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python][NFC] Explain how null cursors are handled in docstring (PR #140499)

2025-05-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/140499 Now that we looked at this aspect closely and fixed things, I think we can document this. >From 445eacab8a326d3abcca95a31f07c272d0d155e7 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 19 May 2025

[clang] [libclang/python][NFC] Document how null cursors are handled (PR #140499)

2025-05-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/140499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python][NFC] Document how null cursors are handled (PR #140499)

2025-05-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/140499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Simplify __eq__ operators (PR #140540)

2025-05-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Why does the diff show that you add `__ne__` operator, even though it's already present? What am I missing? https://github.com/llvm/llvm-project/blob/f3d36b15f6dde7ca2d080279274d5d0f4bfc8c30/clang/bindings/python/clang/cindex.py#L397-L403 https://github.com

[clang] [libclang/python][NFC] Explain how null cursors are handled in docstring (PR #140499)

2025-05-19 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/140499 >From 445eacab8a326d3abcca95a31f07c272d0d155e7 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 19 May 2025 09:24:36 +0300 Subject: [PATCH 1/2] [libclang/python][NFC] Explain how null cursors are ha

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-27 Thread Vlad Serebrennikov via cfe-commits
@@ -358,3 +358,46 @@ Complete example code .. _Index.h: https://github.com/llvm/llvm-project/blob/main/clang/include/clang-c/Index.h + +.. _Stability: + +ABI and API Stability +- + +The C interfaces in libclang are intended to be relatively stable. This a

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-28 Thread Vlad Serebrennikov via cfe-commits
@@ -373,19 +373,21 @@ implementation of the facilities by Clang may change behavior as bugs are fixed, features get implemented, etc. The library should be ABI and API stable over time, but ABI- and API-breaking -changes can happen in the following situations: +changes can ha

[clang] [Docs] Explicitly document libclang ABI and API stability (PR #141657)

2025-05-28 Thread Vlad Serebrennikov via cfe-commits
@@ -373,19 +373,21 @@ implementation of the facilities by Clang may change behavior as bugs are fixed, features get implemented, etc. The library should be ABI and API stable over time, but ABI- and API-breaking -changes can happen in the following situations: +changes can ha

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: I https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,17 @@ +import os + +from clang.cindex import Config, conf, FUNCTION_LIST + +if "CLANG_LIBRARY_PATH" in os.environ: +Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest + + +class TestIndex(unittest.TestCase): +def test_functions_register

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,17 @@ +import os + +from clang.cindex import Config, conf, FUNCTION_LIST + +if "CLANG_LIBRARY_PATH" in os.environ: +Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest + + +class TestIndex(unittest.TestCase): +def test_functions_register

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,17 @@ +import os + +from clang.cindex import Config, conf, FUNCTION_LIST + +if "CLANG_LIBRARY_PATH" in os.environ: +Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest + + +class TestIndex(unittest.TestCase): +def test_functions_register

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,17 @@ +import os + +from clang.cindex import Config, conf, FUNCTION_LIST + +if "CLANG_LIBRARY_PATH" in os.environ: +Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest + + +class TestIndex(unittest.TestCase): +def test_functions_register

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -1545,6 +1545,16 @@ class ExceptionSpecificationKind(BaseEnumeration): ### Cursors ### +# This guard is used to ensure that no operations are possible on null cursors Endilll wrote: I think this comment should also go into high-level matters (that null cu

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,17 @@ +import os + +from clang.cindex import Config, conf, FUNCTION_LIST + +if "CLANG_LIBRARY_PATH" in os.environ: +Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest + + +class TestIndex(unittest.TestCase): +def test_functions_register

[clang] [libclang/python] Ensure all used library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,30 @@ +import os + +import clang.cindex + +if "CLANG_LIBRARY_PATH" in os.environ: +clang.cindex.Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest +import ast + + +class TestLib(unittest.TestCase): +def test_functions_registered(self):

[clang] [libclang/python] Ensure all used library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -1763,19 +1799,22 @@ def get_usr(self): another translation unit.""" return _CXString.from_result(conf.lib.clang_getCursorUSR(self)) -def get_included_file(self): +@cursor_null_guard +def get_included_file(self) -> File: """Returns the F

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -1545,6 +1545,16 @@ class ExceptionSpecificationKind(BaseEnumeration): ### Cursors ### +# This guard is used to ensure that no operations are possible on null cursors Endilll wrote: Yes, I think documentation on hover is helpful, which doesn't work withou

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -77,6 +77,8 @@ Clang Frontend Potentially Breaking Changes Clang Python Bindings Potentially Breaking Changes -- +- Calling methods on null-cursors now leads to an exception. Endilll wrote: ```suggestion - Al

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -77,6 +77,8 @@ Clang Frontend Potentially Breaking Changes Clang Python Bindings Potentially Breaking Changes -- +- Calling methods on null-cursors now leads to an exception. +- ``Cursor.from_location`` now returns ``None`` in

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Can you swap release notes entries? They will make more sense this way when my suggestions are applied https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python][NFC] Refactor wildcard import of `ctypes` (PR #140191)

2025-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/140191 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,17 @@ +import os + +from clang.cindex import Config, conf, FUNCTION_LIST + +if "CLANG_LIBRARY_PATH" in os.environ: +Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"]) + +import unittest + + +class TestIndex(unittest.TestCase): +def test_functions_register

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Can you also add a release note? https://github.com/llvm/llvm-project/pull/138103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python][NFC] Refactor wildcard import of `ctypes` (PR #140191)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/140191 The list is not that long. >From 10ebe5e6ba45e747b3bee2fe686810abf91ded18 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 16 May 2025 08:12:49 +0300 Subject: [PATCH] [libclang/python][NFC] Refactor

[clang] [libclang/python] Ensure all library functions are registered (PR #140015)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: PR title should mention somewhere that only used functions are registered. https://github.com/llvm/llvm-project/pull/140015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -1763,19 +1799,22 @@ def get_usr(self): another translation unit.""" return _CXString.from_result(conf.lib.clang_getCursorUSR(self)) -def get_included_file(self): +@cursor_null_guard +def get_included_file(self) -> File: """Returns the F

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -1552,68 +1563,83 @@ class Cursor(Structure): _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)] +_tu: TranslationUnit + @staticmethod -def from_location(tu, location): +def from_location(tu: TranslationUnit, location: SourceLoc

[clang] [libclang/python] Add typing annotations for the Cursor class (PR #138103)

2025-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -1552,68 +1553,85 @@ class Cursor(Structure): _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)] +_tu: TranslationUnit + +# This ensures that no operations are possible on null cursors +# by guarding all method calls with a not-null

[clang] [clang][python][test] Check if libclang.so is loadable (PR #142353)

2025-06-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/142353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Properly report errors when test fails (PR #142371)

2025-06-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/142371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Properly report errors when test fails (PR #142371)

2025-06-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Have you reproduced the issue and checked that this fix does what's it supposed to do? https://github.com/llvm/llvm-project/pull/142371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [clang][python][test] Check if libclang.so is loadable (PR #142353)

2025-06-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Thank you for the PR. Several points: 1) What happens on Windows? 2) `check-clang-python` is just one of the ways to run into this. `cindex.py` is a user-facing interface, so we shouldn't emit messages that make sense only during development. 3) The fact th

[clang] [clang][python][test] Check if libclang.so is loadable (PR #142353)

2025-06-02 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: @rorth Now that https://github.com/llvm/llvm-project/pull/142371 is merged, can you re-evaluate this PR and update the description? https://github.com/llvm/llvm-project/pull/142353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-06-14 Thread Vlad Serebrennikov via cfe-commits
@@ -1429,7 +1429,7 @@ namespace cwg299 { // cwg299: 2.8 c++11 // cxx98-11-error@#cwg299-q {{ambiguous conversion of array size expression of type 'T' to an integral or enumeration type}} // cxx98-11-note@#cwg299-int {{conversion to integral type 'int' declared here}} /

[clang] [Clang][Sema] Apply CWG400 'Using-declarations and the "struct hack"' to C++98 mode (PR #143492)

2025-06-14 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: It appears that CWG400 has two parts to it: 1. An arguably primary part of the issue is concerned with how many declarations using-declaration can name (one vs many). This is what the recorded discussion is about, and what Richard wrote tests for back in 20

[clang] [libclang/python] Derive library function types from annotations (PR #142120)

2025-06-05 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Good news: typeshed has annotations for ctypes, and they have annotations for `_CPointer` that might come helpful for us: https://github.com/python/typeshed/blob/b25a5b6aef4b18226a9fd367421ed8ebaaed9528/stdlib/_ctypes.pyi#L76-L87 Bad news: they admit that they can't model implici

[clang] [libclang/python] Derive library function types from annotations (PR #142120)

2025-06-05 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: There are useful suggestions in the comments of https://github.com/python/mypy/issues/7540, but it's sad that we need to resort to something like this 10 years after type annotations became a thing. https://github.com/llvm/llvm-project/pull/142120 ___

[clang] [Clang] Implement CWG2496 (PR #142975)

2025-06-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Can you test full 3x3 matrix of combinations of ref-qualifiers between overriding and overridden functions? https://github.com/llvm/llvm-project/pull/142975 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang] Implement CWG2496 (PR #142975)

2025-06-05 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/142975 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement CWG2496 (PR #142975)

2025-06-05 Thread Vlad Serebrennikov via cfe-commits
@@ -215,3 +215,23 @@ void (*q)() throw() = S(); // since-cxx17-error@-1 {{no viable conversion from 'S' to 'void (*)() throw()'}} // since-cxx17-note@#cwg2486-conv {{candidate function}} } // namespace cwg2486 + + +namespace cwg2496 { // cwg2496: 21 +#if __cplusplus >= 20110

[clang] [Clang] Implement CWG2496 (PR #142975)

2025-06-09 Thread Vlad Serebrennikov via cfe-commits
@@ -215,3 +215,32 @@ void (*q)() throw() = S(); // since-cxx17-error@-1 {{no viable conversion from 'S' to 'void (*)() throw()'}} // since-cxx17-note@#cwg2486-conv {{candidate function}} } // namespace cwg2486 + + +namespace cwg2496 { // cwg2496: 21 +#if __cplusplus >= 20110

[clang] [Clang] Implement CWG2496 (PR #142975)

2025-06-09 Thread Vlad Serebrennikov via cfe-commits
@@ -215,3 +215,32 @@ void (*q)() throw() = S(); // since-cxx17-error@-1 {{no viable conversion from 'S' to 'void (*)() throw()'}} // since-cxx17-note@#cwg2486-conv {{candidate function}} } // namespace cwg2486 + + +namespace cwg2496 { // cwg2496: 21 +#if __cplusplus >= 20110

[clang] Remove delayed typo expressions (PR #143423)

2025-06-10 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Changes to DR tests LGTM https://github.com/llvm/llvm-project/pull/143423 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Reject invalid member using-declaration whose nested-name-specifier doesn't refer to a base class of the current class in C++98 mode (PR #143492)

2025-06-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/143492 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Reject invalid member using-declaration whose nested-name-specifier doesn't refer to a base class of the current class in C++98 mode (PR #143492)

2025-06-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: I think we need an entry in "Potentially breaking changes" section. Also, you should shorten the title of the PR, so that commit message is not overly long. Maybe something along the lines of `[clang] Require member using-declarations to name a base class`.

<    18   19   20   21   22   23   24   >