[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Vlad Serebrennikov via cfe-commits
@@ -279,6 +280,90 @@ def test_is_default_method(self): self.assertTrue(xc.is_default_method()) self.assertFalse(yc.is_default_method()) +def test_is_deleted_method(self): +source = "class X { X() = delete; }; class Y { Y(); };" +tu = get_tu(

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Vlad Serebrennikov via cfe-commits
@@ -357,6 +359,50 @@ def test_is_restrict_qualified(self): self.assertTrue(i.type.is_restrict_qualified()) self.assertFalse(j.type.is_restrict_qualified()) +def test_get_result(self): +tu = get_tu("void foo(); int bar(char, short);") +foo =

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-24 Thread Vlad Serebrennikov via cfe-commits
@@ -357,6 +359,50 @@ def test_is_restrict_qualified(self): self.assertTrue(i.type.is_restrict_qualified()) self.assertFalse(j.type.is_restrict_qualified()) +def test_get_result(self): +tu = get_tu("void foo(); int bar(char, short);") +foo =

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-27 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/109846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-27 Thread Vlad Serebrennikov via cfe-commits
@@ -2454,7 +2480,7 @@ def element_type(self): If accessed on a type that is not an array, complex, or vector type, an exception will be raised. """ -result = conf.lib.clang_getElementType(self) +result = Type.from_result(conf.lib.clang_ge

[clang] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-27 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. https://github.com/llvm/llvm-project/pull/105490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)

2024-09-27 Thread Vlad Serebrennikov via cfe-commits
@@ -231,6 +245,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_tes

[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)

2024-09-28 Thread Vlad Serebrennikov via cfe-commits
@@ -231,6 +245,10 @@ linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_pro linux_check_targets=$(check-targets ${linux_projects_to_test} | sort | uniq) linux_projects=$(add-dependencies ${linux_projects_to_test} | sort | uniq) +linux_runtimes_to_tes

[clang] [llvm] [clang][ci] Move libc++ testing into the main PR pipeline (PR #93318)

2024-09-28 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/93318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Hm https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-20 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-20 Thread Vlad Serebrennikov via cfe-commits
@@ -1952,6 +1952,8 @@ def enum_value(self): underlying_type = self.type if underlying_type.kind == TypeKind.ENUM: underlying_type = underlying_type.get_declaration().enum_type +if underlying_type.kind == TypeKind.ELABORATED: -

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-01 Thread Vlad Serebrennikov via cfe-commits
@@ -600,6 +600,7 @@ namespace cwg336 { // cwg336: yes template<> template class A::B {}; template<> template<> template void A::B::mf1(T t) {} // expected-error@-1 {{out-of-line definition of 'mf1' does not match any declaration in 'cwg336::Pre::A::B'}} +// exp

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-01 Thread Vlad Serebrennikov via cfe-commits
@@ -108,6 +108,7 @@ namespace MultilevelSpecialization { template<> template void B::f(int i, int (&arr1)[a], int (&arr2)[b]) {} // since-cxx11-error@-1 {{out-of-line definition of 'f' does not match any declaration in 'cwg2233::MultilevelSpecialization::B'}} +//

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-01 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Implementation seems fine to me, but wait for other reviewers before merging. https://github.com/llvm/llvm-project/pull/110638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [libclang/python] Improve test coverage (PR #109846)

2024-09-25 Thread Vlad Serebrennikov via cfe-commits
@@ -357,6 +359,50 @@ def test_is_restrict_qualified(self): self.assertTrue(i.type.is_restrict_qualified()) self.assertFalse(j.type.is_restrict_qualified()) +def test_get_result(self): +tu = get_tu("void foo(); int bar(char, short);") +foo =

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -102,12 +102,13 @@ namespace MultilevelSpecialization { // default argument -- how far back do we look when determining whether a // parameter was expanded from a pack? // -- zygoloid 2020-06-02 - template struct B { + template struct B { // #defined-here temp

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -758,16 +759,18 @@ namespace cwg347 { // cwg347: yes void g(); }; - struct derived : base {}; + struct derived : base {}; // #defined-here-derived struct derived::nested {}; // expected-error@-1 {{no struct named 'nested' in 'cwg347::derived'}} int derive

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -1009,18 +1012,20 @@ namespace cwg355 { struct ::cwg355_S s; } // cwg356: na namespace cwg357 { // cwg357: yes - template struct A { + template struct A { // #defined-here-cwg357-A void f() const; // #cwg357-f }; template void A::f() {} // expected-error@-1

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -597,9 +597,10 @@ namespace cwg336 { // cwg336: yes void mf2(); }; }; -template<> template class A::B {}; +template<> template class A::B {}; // #defined-here-cwg336 Endilll wrote: ```suggestion template<> template class A::B {

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -597,9 +597,10 @@ namespace cwg336 { // cwg336: yes void mf2(); }; }; -template<> template class A::B {}; +template<> template class A::B {}; // #defined-here-cwg336 template<> template<> template void A::B::mf1(T t) {} // expected-error@-

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -758,16 +759,18 @@ namespace cwg347 { // cwg347: yes void g(); }; - struct derived : base {}; + struct derived : base {}; // #defined-here-derived Endilll wrote: ```suggestion struct derived : base {}; // #cwg347-derived ``` https://github.com/l

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -1009,18 +1012,20 @@ namespace cwg355 { struct ::cwg355_S s; } // cwg356: na namespace cwg357 { // cwg357: yes - template struct A { + template struct A { // #defined-here-cwg357-A void f() const; // #cwg357-f }; template void A::f() {} // expected-error@-1

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -102,12 +102,13 @@ namespace MultilevelSpecialization { // default argument -- how far back do we look when determining whether a // parameter was expanded from a pack? // -- zygoloid 2020-06-02 - template struct B { + template struct B { // #defined-here -

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -1009,18 +1012,20 @@ namespace cwg355 { struct ::cwg355_S s; } // cwg356: na namespace cwg357 { // cwg357: yes - template struct A { + template struct A { // #defined-here-cwg357-A void f() const; // #cwg357-f }; template void A::f() {} // expected-error@-1

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -758,16 +759,18 @@ namespace cwg347 { // cwg347: yes void g(); }; - struct derived : base {}; + struct derived : base {}; // #defined-here-derived struct derived::nested {}; // expected-error@-1 {{no struct named 'nested' in 'cwg347::derived'}} int derive

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -1009,18 +1012,20 @@ namespace cwg355 { struct ::cwg355_S s; } // cwg356: na namespace cwg357 { // cwg357: yes - template struct A { + template struct A { // #defined-here-cwg357-A void f() const; // #cwg357-f }; template void A::f() {} // expected-error@-1

[clang] [Clang] Emit a diagnostic note at the class declaration when the method definition does not match any declaration. (PR #110638)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -1009,18 +1012,20 @@ namespace cwg355 { struct ::cwg355_S s; } // cwg356: na namespace cwg357 { // cwg357: yes - template struct A { + template struct A { // #defined-here-cwg357-A Endilll wrote: ```suggestion template struct A { // #cwg357-A ``` http

[clang] [Clang][NFC] Rearrange tests for CWG 2707 after #110473 (PR #110842)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: LGTM otherwise https://github.com/llvm/llvm-project/pull/110842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][NFC] Rearrange tests for CWG 2707 after #110473 (PR #110842)

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

[clang] [Clang][NFC] Rearrange tests for CWG 2707 after #110473 (PR #110842)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -29,6 +29,35 @@ namespace std { #endif } // namespace std +namespace cwg2707 { // cwg2707: 20 + +#if __cplusplus >= 202002L + +template struct A { // #cwg2707-A + T value[N]; +}; + +template +A(T...) -> A requires (sizeof...(T) == 2); // #cwg2707-guide-A + +// Brace eli

[clang] [Clang][NFC] Rearrange tests for CWG 2707 after #110473 (PR #110842)

2024-10-02 Thread Vlad Serebrennikov via cfe-commits
@@ -29,6 +29,35 @@ namespace std { #endif } // namespace std +namespace cwg2707 { // cwg2707: 20 + +#if __cplusplus >= 202002L + +template struct A { // #cwg2707-A + T value[N]; +}; + +template +A(T...) -> A requires (sizeof...(T) == 2); // #cwg2707-guide-A + +// Brace eli

[clang] [Clang][NFC] Rearrange tests for CWG 2707 after #110473 (PR #110842)

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

[clang] Turn Wdeprecated-literal-operator on by default (PR #111027)

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

[clang] Turn Wdeprecated-literal-operator on by default (PR #111027)

2024-10-03 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: The rest of changes to DR tests look good. https://github.com/llvm/llvm-project/pull/111027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Turn Wdeprecated-literal-operator on by default (PR #111027)

2024-10-03 Thread Vlad Serebrennikov via cfe-commits
@@ -203,6 +203,9 @@ namespace cwg1762 { // cwg1762: 14 float operator ""E(const char *); // since-cxx11-error@-1 {{invalid suffix on literal; C++11 requires a space between literal and identifier}} // since-cxx11-warning@-2 {{user-defined literal suffixes not starting wi

[clang] Turn `-Wdeprecated-literal-operator` on by default (PR #111027)

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

[clang] Add `EvalASTMutator` interface (PR #115168)

2024-11-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/115168 >From 5ca48e03412b1b8e9253f13356b9cc957f6fd9e5 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Nov 2024 17:58:43 +0300 Subject: [PATCH 1/5] Add EvalASTMutator interface with `InstantiateFunctionD

[clang] Add `EvalASTMutator` interface (PR #115168)

2024-11-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/115168 >From 5ca48e03412b1b8e9253f13356b9cc957f6fd9e5 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Nov 2024 17:58:43 +0300 Subject: [PATCH 1/4] Add EvalASTMutator interface with `InstantiateFunctionD

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-07 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/115168 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Add test for CWG1898 "Use of “equivalent” in overload resolution" (PR #113439)

2024-10-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/113439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Add test for CWG issues about linkage in cross-TU context (PR #113736)

2024-10-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/113736 CWG issues [CWG279](https://cplusplus.github.io/CWG/issues/279.html) Correspondence of "names for linkage purposes" [P1787R6](https://wg21.link/p1787r6): > CWG1884, CWG279, and CWG338 are

[clang] [clang][NFC] Add test for CWG issues about linkage in cross-TU context (PR #113736)

2024-10-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: @ChuanqiXu9 Can you take a quick look to make sure I'm not tripping over any modules lines in those tests? This is the PR I promised to pull you in almost 2 weeks ago (sorry for the delay 😄). https://github.com/llvm/llvm-project/pull/113736 __

[clang] [clang][NFC] Add test for CWG issues about linkage in cross-TU context (PR #113736)

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

[clang] [clang][NFC] Add test for CWG issues about linkage in cross-TU context (PR #113736)

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

[clang] [llvm] [AMDGPU] Add a type for the named barrier (PR #113614)

2024-10-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Ah, so it's the issue of PRs not being tested against `main`. https://github.com/llvm/llvm-project/pull/113614 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Add test for CWG issues about linkage in cross-TU context (PR #113736)

2024-10-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Also, having to use absolute line numbers in expected directives sucks. I hope I wouldn't need to change any comments at the top of CWG1884 test. At some point I'll make `-verify` markers work for cross-TU scenarios. https://github.com/llvm/llvm-project/pull/113736 _

[clang] [llvm] [AMDGPU] Add a type for the named barrier (PR #113614)

2024-10-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: How did this get through pre-merge testing, I wonder. https://github.com/llvm/llvm-project/pull/113614 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Check null TypeSourceInfo in CreateUnaryExprOrTypeTraitExpr (PR #112111)

2024-10-15 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +a() {struct b c (sizeof(b * [({ {tree->d* next)} 0 + +// expected-error@3 {{a type specifier is required for all declarations}} +// expected-error@3 {{use of undeclared identifier 'tree'; did you mean 'true'?}} +//

[clang] [clang] Check null TypeSourceInfo in CreateUnaryExprOrTypeTraitExpr (PR #112111)

2024-10-17 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +a() {struct b c (sizeof(b * [({ {tree->d* next)} 0 + +// expected-error@3 {{a type specifier is required for all declarations}} +// expected-error@3 {{use of undeclared identifier 'tree'; did you mean 'true'?}} +//

[clang] [Clang] Fix name lookup for dependent bases (PR #114978)

2024-11-06 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Also, do you have any ideas why the Win pipeline fails with checkout failure? > How can I fix it? It seems to be unrelated to you. Might be fixed when you'll push a new commit. https://github.com/llvm/llvm-project/pull/114978 ___ cfe

[clang] [Clang] Fix name lookup for dependent bases (PR #114978)

2024-11-06 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > @Endilll, please, could you take a look? My knowledge of wording about templates is not deep enough, unfortunately. https://github.com/llvm/llvm-project/pull/114978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] Add `EvalASTMutator` interface (PR #115168)

2024-11-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/115168 None >From 5ca48e03412b1b8e9253f13356b9cc957f6fd9e5 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Nov 2024 17:58:43 +0300 Subject: [PATCH 1/2] Add EvalASTMutator interface with `InstantiateFun

[clang] Add `EvalASTMutator` interface (PR #115168)

2024-11-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/115168 >From 5ca48e03412b1b8e9253f13356b9cc957f6fd9e5 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Nov 2024 17:58:43 +0300 Subject: [PATCH 1/3] Add EvalASTMutator interface with `InstantiateFunctionD

[clang] [Clang] Fix name lookup for dependent bases (PR #114978)

2024-11-06 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > > > @Endilll, please, could you take a look? > > > > > > My knowledge of wording about templates is not deep enough, unfortunately. > > Could you, please, suggest someone who can review this part? I've already added several people who should be able to, but mind that we're v

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/115168 >From 5ca48e03412b1b8e9253f13356b9cc957f6fd9e5 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Nov 2024 17:58:43 +0300 Subject: [PATCH 01/13] Add EvalASTMutator interface with `InstantiateFunctio

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: I added Sema callback into the new interpreter in 0b2d92e0fed41ee2428c3ef8b8369790a1279a21. I think it went smoothly, save for the fact that source locations are not always readily available there, but they are need to correctly emit diagnostics from Sema. I invite @tbaederr to

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: @zygoloid I definitely don't disagree with your points. After extensive discussions with other maintainers (Shafik, Corentin, Erich, Aaron), I went from passing the callback explicitly to very implicit approach, because of reasons that lie outside of usage of AST in Clang itself

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > the special "the language rules say this is manifestly constant evaluated" > cases that should be able to perform AST mutations, that we need to be > extremely careful to invoke at exactly the right times and in exactly the > right cases and to invoke only once Can you expand

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/115168 >From 5ca48e03412b1b8e9253f13356b9cc957f6fd9e5 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Nov 2024 17:58:43 +0300 Subject: [PATCH 1/8] Add EvalASTMutator interface with `InstantiateFunctionD

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-15 Thread Vlad Serebrennikov via cfe-commits
@@ -182,6 +182,17 @@ struct TypeInfoChars { } }; +// Interface that allows constant evaluator to mutate AST. +// Sema is the only entity that can implement this. +struct EvalASTMutator { + virtual ~EvalASTMutator() = default; + + virtual void + InstantiateFunctionDefiniti

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-15 Thread Vlad Serebrennikov via cfe-commits
@@ -8328,6 +8329,13 @@ class ExprEvaluatorBase const FunctionDecl *Definition = nullptr; Stmt *Body = FD->getBody(Definition); +if (Info.Ctx.getLangOpts().CPlusPlus26 && Info.getASTMutator() && Endilll wrote: Fixed https://github.com/llvm/llvm-pr

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-26 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > For such an implementation that makes that choice, it would seem appropriate > for define_aggregate to also be idempotent. But that should be a specific > rule for that implementation, not a rule that appears in the standard. And we > certainly shouldn't change the standard to

[clang] 88a9bca - [clang][NFC] Update `cxx_dr_status.html`

2024-09-17 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2024-09-17T12:12:49+03:00 New Revision: 88a9bcaf7074d21aa818cfa3952300dc9547be77 URL: https://github.com/llvm/llvm-project/commit/88a9bcaf7074d21aa818cfa3952300dc9547be77 DIFF: https://github.com/llvm/llvm-project/commit/88a9bcaf7074d21aa818cfa3952300dc9547be77.

[clang] [Clang] Reject `this void` explicit object parameters (CWG2915) (PR #108817)

2024-09-17 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > @Endilll: I've removed the other changes from `cxx_dr_status.html` manually > from this commit. Can you create the separate patch to add the new cwg > issues? Thanks! Pushed 331d65d0e271d22da9f496f2bb628b93ab515725 https://github.com/llvm/llvm-project/pull/108817

[clang] [Clang] Reject `this void` explicit object parameters (CWG2915) (PR #108817)

2024-09-17 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > @Endilll: I've removed the other changes from `cxx_dr_status.html` manually > from this commit. Can you create the separate patch to add the new cwg > issues? Thanks! Pushed 88a9bcaf7074d21aa818cfa3952300dc9547be77 https://github.com/llvm/llvm-project/pull/108817

[clang] Reland "[Utils] add update-verify-tests.py" (#108630)" (PR #108658)

2024-09-17 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > That was always true, in the sense that there's nothing preventing the author > from doing the exact same thing: looking at the output from the clang -verify > failure and adding/removing expected diagnostics until it matches. In fact, > even without this script that is the mo

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/115168 >From 5ca48e03412b1b8e9253f13356b9cc957f6fd9e5 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Nov 2024 17:58:43 +0300 Subject: [PATCH 01/10] Add EvalASTMutator interface with `InstantiateFunctio

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-15 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > @zygoloid @katzdm for awareness This PR is still in flux. Discussions are lengthy and typically happen in meetings. My plan is to get to a stable point, write down how we got there, alternatives rejected (with reasoning), and get the PR out of the draft status. This would be

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/115168 >From 5ca48e03412b1b8e9253f13356b9cc957f6fd9e5 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 6 Nov 2024 17:58:43 +0300 Subject: [PATCH 01/11] Add EvalASTMutator interface with `InstantiateFunctio

[clang] Enable AST mutation in the constant evaluator (PR #115168)

2024-11-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > > > the special "the language rules say this is manifestly constant > > > evaluated" cases that should be able to perform AST mutations, that we > > > need to be extremely careful to invoke at exactly the right times and in > > > exactly the right cases and to invoke only once

[clang] [lldb] [Clang] Improve Sema diagnostic performance for __builtin_counted_by_ref (PR #116719)

2024-11-25 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: For the record, Aaron is not on vacation. So if you need his sign-off, you should wait. https://github.com/llvm/llvm-project/pull/116719 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
@@ -174,6 +174,26 @@ static_assert(!__is_layout_compatible(StructWithAnonUnion, StructWithAnonUnion3) #endif } // namespace cwg2759 +#if __cplusplus >= 202002L +namespace cwg2770 { // cwg2770: 20 Endilll wrote: > Yes, I implemented what that issue proposed.

[clang] eff1265 - [clang][NFC] Fix expected directives in C++ DRs

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-01-06T12:29:31+03:00 New Revision: eff126501efc3981727ef0e918c4dca0fa2eb778 URL: https://github.com/llvm/llvm-project/commit/eff126501efc3981727ef0e918c4dca0fa2eb778 DIFF: https://github.com/llvm/llvm-project/commit/eff126501efc3981727ef0e918c4dca0fa2eb778.

[clang] 2a593bb - [clang][NFC] Stop testing CWG2917 in C++98 mode

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-01-06T12:24:18+03:00 New Revision: 2a593bbcf3b022a4ac11a76e03883d6aae2f000c URL: https://github.com/llvm/llvm-project/commit/2a593bbcf3b022a4ac11a76e03883d6aae2f000c DIFF: https://github.com/llvm/llvm-project/commit/2a593bbcf3b022a4ac11a76e03883d6aae2f000c.

[clang] [clang] Add test for CWG203 "Type of address-of-member expression" (PR #121687)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/121687 >From bca2bfe17b71faeebf65eba11adcb70927f878fd Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 5 Jan 2025 13:58:16 +0300 Subject: [PATCH 1/3] [clang] Add test for CWG203 "Type of address-of-member

[clang] [clang] Add test for CWG203 "Type of address-of-member expression" (PR #121687)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/121687 >From bca2bfe17b71faeebf65eba11adcb70927f878fd Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Sun, 5 Jan 2025 13:58:16 +0300 Subject: [PATCH 1/4] [clang] Add test for CWG203 "Type of address-of-member

[clang] [clang] Add test for CWG203 "Type of address-of-member expression" (PR #121687)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
@@ -41,6 +42,141 @@ namespace cwg202 { // cwg202: 3.1 template struct X; } +namespace cwg203 { // cwg203: 3.0 +namespace ex1 { +struct B { + int i; +}; +struct D1 : B {}; +struct D2 : B {}; + +int(D1::*pmD1) = &D2::i; +} // namespace ex1 + +#if __cplusplus >= 202002L +names

[clang] [clang] Add test for CWG203 "Type of address-of-member expression" (PR #121687)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
@@ -41,6 +42,141 @@ namespace cwg202 { // cwg202: 3.1 template struct X; } +namespace cwg203 { // cwg203: 3.0 +namespace ex1 { +struct B { + int i; +}; +struct D1 : B {}; +struct D2 : B {}; + +int(D1::*pmD1) = &D2::i; +} // namespace ex1 + +#if __cplusplus >= 202002L +names

[clang] [clang] Add test for CWG203 "Type of address-of-member expression" (PR #121687)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
@@ -41,6 +42,141 @@ namespace cwg202 { // cwg202: 3.1 template struct X; } +namespace cwg203 { // cwg203: 3.0 +namespace ex1 { +struct B { + int i; +}; +struct D1 : B {}; +struct D2 : B {}; + +int(D1::*pmD1) = &D2::i; +} // namespace ex1 + +#if __cplusplus >= 202002L +names

[clang] 1229b78 - [clang][NFC] Clean up CWG2396 test

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-01-06T18:32:44+03:00 New Revision: 1229b78f1676d56d0d386a5c4cde8f98a78d0989 URL: https://github.com/llvm/llvm-project/commit/1229b78f1676d56d0d386a5c4cde8f98a78d0989 DIFF: https://github.com/llvm/llvm-project/commit/1229b78f1676d56d0d386a5c4cde8f98a78d0989.

[clang] [llvm] [SPIRV] Add Target Builtins using Distance ext as an example (PR #121598)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. Yes, you handled the creation of `SemaSPIRV` perfectly. (I'm the one who introduced the rest of `Sema*` parts.) https://github.com/llvm/llvm-project/pull/121598 ___ cfe-commits mailing list cfe-com

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
@@ -174,6 +174,26 @@ static_assert(!__is_layout_compatible(StructWithAnonUnion, StructWithAnonUnion3) #endif } // namespace cwg2759 +#if __cplusplus >= 202002L +namespace cwg2770 { // cwg2770: 20 Endilll wrote: CWG2770 is still open (`clang/www/make_cxx_dr_s

[clang] b79d3b9 - [clang][NFC] Move CWG273 test into its own file

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-01-06T17:30:39+03:00 New Revision: b79d3b9519620e34f0e223fdb4a6731db6cda88f URL: https://github.com/llvm/llvm-project/commit/b79d3b9519620e34f0e223fdb4a6731db6cda88f DIFF: https://github.com/llvm/llvm-project/commit/b79d3b9519620e34f0e223fdb4a6731db6cda88f.

[clang] [clang] Improve `make_cxx_dr_status` behavior when error occurs (PR #121785)

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/121785 One of our contributors got confused by the behavior of the script when they incorrectly specified the status of a CWG issue (https://github.com/llvm/llvm-project/pull/102857/files#r1904264872), and this is an

[clang] [clang] Add test for CWG203 "Type of address-of-member expression" (PR #121687)

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

[clang] [AArch64][SME] Add diagnostics for SME attributes on lambda functions (PR #121777)

2025-01-07 Thread Vlad Serebrennikov via cfe-commits
@@ -1328,4 +1328,57 @@ void SemaARM::handleInterruptAttr(Decl *D, const ParsedAttr &AL) { ARMInterruptAttr(getASTContext(), AL, Kind)); } +// Check if the function definition uses any AArch64 SME features without +// having the '+sme' feature enabled and warn

[clang] [clang] Improve `make_cxx_dr_status` behavior when error occurs (PR #121785)

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

[clang] 3c5f269 - [clang][NFC] Stop using atypical compiler arguments in C++ DR tests

2025-01-06 Thread Vlad Serebrennikov via cfe-commits
Author: Vlad Serebrennikov Date: 2025-01-06T12:58:15+03:00 New Revision: 3c5f2698b02ae3cec13551226f083984ab41f0f3 URL: https://github.com/llvm/llvm-project/commit/3c5f2698b02ae3cec13551226f083984ab41f0f3 DIFF: https://github.com/llvm/llvm-project/commit/3c5f2698b02ae3cec13551226f083984ab41f0f3.

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Vlad Serebrennikov via cfe-commits
@@ -1058,8 +1061,10 @@ namespace cwg62 { // cwg62: 2.9 // cxx98-error@-1 {{template argument uses local type }} get(); // cxx98-error@-1 {{template argument uses local type }} +// cxx98-note@-2 {{while substituting explicitly-specified template arguments}}

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Vlad Serebrennikov via cfe-commits
@@ -1386,6 +1386,7 @@ namespace cwg488 { // cwg488: 2.9 c++11 enum E { e }; f(e); // cxx98-error@-1 {{template argument uses local type 'E'}} +// cxx98-note@-2 {{while substituting deduced template arguments}} Endilll wrote: ```suggestion /

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Vlad Serebrennikov via cfe-commits
@@ -1058,8 +1061,10 @@ namespace cwg62 { // cwg62: 2.9 // cxx98-error@-1 {{template argument uses local type }} get(); // cxx98-error@-1 {{template argument uses local type }} +// cxx98-note@-2 {{while substituting explicitly-specified template arguments}}

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

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

[clang] [clang] print correct context for diagnostics suppressed by deduction (PR #125453)

2025-02-03 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Changes to C++ DR tests look good otherwise. https://github.com/llvm/llvm-project/pull/125453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-02-06 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Thank you for working on this I know too little of packaging in Python to approve, but let's try to get more eyes on this. CC @DeinAlptraum @sighingnow https://github.com/llvm/llvm-project/pull/125806 ___ cfe-com

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-02-06 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,36 @@ +[build-system] +requires = ["setuptools>=42", "setuptools_scm==8.1.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "clang" +description = "libclang python bindings" +readme = {file = "README.txt", content-type = "text/plain"} + +license = {text

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-02-06 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,34 @@ +[build-system] +requires = ["setuptools>=42", "setuptools_scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "clang" +description = "libclang python bindings" +readme = {file = "README.txt", content-type = "text/plain"} + +license = { text = "Apa

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

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

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

2025-02-09 Thread Vlad Serebrennikov via cfe-commits
@@ -196,6 +196,16 @@ void g() { #endif } // namespace cwg2277 +namespace cwg2285 { // cwg2285: 4 Endilll wrote: It seems that Clang 5 was the first release which exhibits the correct behavior: https://godbolt.org/z/qabGrdvPq https://github.com/llvm/llvm-pro

[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

2025-02-06 Thread Vlad Serebrennikov via cfe-commits
@@ -0,0 +1,36 @@ +[build-system] +requires = ["setuptools>=42", "setuptools_scm==8.1.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "clang" +description = "libclang python bindings" +readme = {file = "README.txt", content-type = "text/plain"} + +license = {text

<    15   16   17   18   19   20   21   22   23   24   >