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

2024-10-04 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: I'm happy that we stop issuing diagnostics that contradict each other. https://github.com/llvm/llvm-project/pull/111027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

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

2024-10-04 Thread Vlad Serebrennikov via cfe-commits
@@ -99,6 +99,20 @@ C++ Specific Potentially Breaking Changes // Was error, now evaluates to false. constexpr bool b = f() == g(); +- The warning ``-Wdeprecated-literal-operator`` is now on by default, as this is + something that WG21 has shown interest in removing fr

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

2024-10-04 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
@@ -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] 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 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
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] [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] [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 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
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] 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
https://github.com/Endilll commented: LGTM otherwise https://github.com/llvm/llvm-project/pull/110638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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 { // #cwg357-A void f() const; // #cwg357-f }; template void A::f() {} // expected-error@-1 {{out-of-line

[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
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/110638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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
@@ -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
@@ -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 Endilll wrote: ```suggestion template struct A { // #cwg357-A ``` http

[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
@@ -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 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
@@ -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-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
@@ -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
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] [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] [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] [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] [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] 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] [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] [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] [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
https://github.com/Endilll commented: I have to admit I can't assess the completeness of those tests, but they are certainly welcome. Thank you! https://github.com/llvm/llvm-project/pull/109846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

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

2024-09-24 Thread Vlad Serebrennikov via cfe-commits
@@ -46,6 +46,8 @@ def test_diagnostic_fixit(self): self.assertEqual(tu.diagnostics[0].location.column, 26) self.assertRegex(tu.diagnostics[0].spelling, "use of GNU old-style.*") self.assertEqual(len(tu.diagnostics[0].fixits), 1) +with self.assert

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

2024-09-24 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited 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] Improve test coverage (PR #109846)

2024-09-24 Thread Vlad Serebrennikov via cfe-commits
@@ -625,6 +762,25 @@ def test_result_type_objc_method_decl(self): self.assertEqual(cursor.kind, CursorKind.OBJC_INSTANCE_METHOD_DECL) self.assertEqual(result_type.kind, TypeKind.VOID) +def test_storage_class(self): +tu = get_tu( +""" +ex

[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] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-23 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-23 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] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-21 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] [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] [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] 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] [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] [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] 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-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: LGTM, but it would be nice for @cor3ntin to rubber-stamp it before merging. https://github.com/llvm/llvm-project/pull/108817 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

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

2024-09-12 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Should I add tests for all of these first, and then merge that into this PR? That would be nice! https://github.com/llvm/llvm-project/pull/105490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

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

2024-09-12 Thread Vlad Serebrennikov via cfe-commits
@@ -3524,16 +3564,20 @@ def getCompileCommands(self, filename): Get an iterable object providing all the CompileCommands available to build filename. Returns None if filename is not found in the database. """ -return conf.lib.clang_CompilationDat

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

2024-09-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited 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] [libclang/python] Do not rely on `ctypes`' `errcheck` (PR #105490)

2024-09-12 Thread Vlad Serebrennikov via cfe-commits
@@ -3743,82 +3765,62 @@ def write_main_file_to_stdout(self): ("clang_equalLocations", [SourceLocation, SourceLocation], bool), ("clang_equalRanges", [SourceRange, SourceRange], bool), ("clang_equalTypes", [Type, Type], bool), -("clang_formatDiagnostic", [Diagnos

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

2024-09-12 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-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll commented: Any chance you were able to test those changes? 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] [NFC] Move warning from CodeGen to Sema. (PR #107397)

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

[clang] [NFC] Move warning from CodeGen to Sema. (PR #107397)

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

[clang] [NFC] Move warning from CodeGen to Sema. (PR #107397)

2024-09-12 Thread Vlad Serebrennikov via cfe-commits
@@ -626,6 +626,11 @@ class Sema final : public SemaBase { const llvm::MapVector & getMismatchingDeleteExpressions() const; + std::vector> + ExcessPrecisionNotSatisfied; Endilll wrote: Or `(Num >1 ? 1 : 0)` if you wany https://github.com/llvm/llvm-p

[clang] [NFC] Move warning from CodeGen to Sema. (PR #107397)

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

[clang] [NFC] Move warning from CodeGen to Sema. (PR #107397)

2024-09-12 Thread Vlad Serebrennikov via cfe-commits
@@ -1180,6 +1180,16 @@ void Sema::PrintPragmaAttributeInstantiationPoint() { diag::note_pragma_attribute_applied_decl_here); } +void Sema::DiagnoseExcessPrecision() { + if (NumExcessPrecisionNotSatisfied > 0) { +for (auto &[Loc, Type, Num] : ExcessPrecision

[clang] [NFC] Move warning from CodeGen to Sema. (PR #107397)

2024-09-12 Thread Vlad Serebrennikov via cfe-commits
@@ -626,6 +626,11 @@ class Sema final : public SemaBase { const llvm::MapVector & getMismatchingDeleteExpressions() const; + std::vector> + ExcessPrecisionNotSatisfied; Endilll wrote: I think all three data members should be moved down to `SemaExpr.

[clang] [NFC] Move warning from CodeGen to Sema. (PR #107397)

2024-09-12 Thread Vlad Serebrennikov via cfe-commits
@@ -1180,6 +1180,16 @@ void Sema::PrintPragmaAttributeInstantiationPoint() { diag::note_pragma_attribute_applied_decl_here); } +void Sema::DiagnoseExcessPrecision() { + if (NumExcessPrecisionNotSatisfied > 0) { +for (auto &[Loc, Type, Num] : ExcessPrecision

[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

2024-09-08 Thread Vlad Serebrennikov via cfe-commits
@@ -206,19 +206,28 @@ namespace cwg1814 { // cwg1814: yes #endif } -namespace cwg1815 { // cwg1815: no +namespace cwg1815 { // cwg1815: 19 Endilll wrote: Seems to be the case, yeah. >From what I see, this effort was started back before 19 has branched, and wa

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-04 Thread Vlad Serebrennikov via cfe-commits
@@ -15099,6 +15037,106 @@ class Sema final : public SemaBase { std::string getFixItZeroLiteralForType(QualType T, SourceLocation Loc) const; ///@} + + // Endilll wrote: Yes, this is consistent with the rest of Sema.h https://github.com/llvm/llvm-project

[clang] [clang] Add tests for CWG issues about language linkage (PR #107019)

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

[clang] [clang] Add test for CWG2486 (`noexcept` and function pointer conversion) (PR #107131)

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

[clang] [clang] Add test for CWG2486 (`noexcept` and function pointer conversion) (PR #107131)

2024-09-03 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/107131 [CWG2486](https://cplusplus.github.io/CWG/issues/2486.html) "Call to `noexcept` function via `noexcept(false)` pointer/lvalue" allows `noexcept` functions to be called via `noexcept(false)` pointers or values.

[clang] [clang] Add tests for CWG issues about language linkage (PR #107019)

2024-09-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/107019 This patch covers Core issues about language linkage during declaration matching resolved in [P1787R6](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1787r6.html), namely [CWG563](https://cplusplus.

[clang] [clang] Add tests for CWG issues about friend declaration matching (PR #106117)

2024-09-02 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: The failure is unrelated. https://github.com/llvm/llvm-project/pull/106117 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add tests for CWG issues about friend declaration matching (PR #106117)

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

[clang] [clang] Add tests for CWG issues about friend declaration matching (PR #106117)

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

[clang] [clang] Add tests for CWG issues about friend declaration matching (PR #106117)

2024-09-02 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: @cor3ntin Can you take another look? I added CWG1900 section to the PR description. Nothing has changes for other Core issues. https://github.com/llvm/llvm-project/pull/106117 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang] Add tests for CWG issues about friend declaration matching (PR #106117)

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

[clang] [clang] Add tests for CWG issues about friend declaration matching (PR #106117)

2024-09-02 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/106117 >From 65307bd2f5f8ca5c6aaa24335c77a63280d668e3 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Mon, 26 Aug 2024 20:45:31 +0300 Subject: [PATCH 1/5] [clang] Add tests for CWG issues about friend declarati

[clang] [clang] Add tests for CWG issues about friend declaration matching (PR #106117)

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

[clang] [NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (PR #106453)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll approved this pull request. Thank you for resolving your issue the hard way, and paying some of the technical debt we accumulated over the years. https://github.com/llvm/llvm-project/pull/106453 ___ cfe-commits mailing list

[clang] [NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (PR #106453)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
@@ -204,6 +204,24 @@ class SemaPPCallbacks; class TemplateDeductionInfo; } // namespace sema +// AssignmentAction - This is used by all the assignment diagnostic functions +// to represent what is actually causing the operation +enum class AssignmentAction : unsigned { + Assi

[clang] [NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (PR #106453)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > @Endilll This is my attempt at implementing what you asked for in [#106321 > (comment)](https://github.com/llvm/llvm-project/pull/106321#discussion_r1734379624) > > I'm not a huge fan of this as I think this will be extremely annoying for > downstream forks with very little up

[clang] [NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (PR #106453)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
@@ -204,6 +204,24 @@ class SemaPPCallbacks; class TemplateDeductionInfo; } // namespace sema +// AssignmentAction - This is used by all the assignment diagnostic functions +// to represent what is actually causing the operation +enum class AssignmentAction : unsigned { ---

[clang] [Clang][AST] Add Test Cases for Reference Qualifiers in Opr Overload (PR #102878)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: Here's an example: https://github.com/llvm/llvm-project/blob/114ff99e93edd699fd94cf2a84de75e8845fc76b/clang/test/CXX/drs/cwg10xx.cpp#L85-L90 https://github.com/llvm/llvm-project/pull/102878 ___ cfe-commits mailing list cfe-commits@lists.

[clang] [Clang][AST] Add Test Cases for Reference Qualifiers in Opr Overload (PR #102878)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > @cor3ntin The solution here #79748 doesn't pass the test too. Kinda expected > not to pass the test clang If tests are not intended to pass, you should expect the diagnostics we issue today, and leave FIXMEs appropriately to indicate where Clang's behavior is wrong. https://

[clang] [clang] Minor updates to C++ DR page design (PR #106360)

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

[clang] [clang] Add tests for CWG issues about friend declaration matching (PR #106117)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
@@ -568,6 +568,80 @@ namespace cwg137 { // cwg137: yes const volatile int *cvqcv = static_cast(cvp); } +namespace cwg138 { // cwg138: partial +namespace example1 { +void foo(); // #cwg138-ex1-foo +namespace A { + using example1::foo; // #cwg138-ex1-using + class X { +s

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

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
@@ -101,6 +101,26 @@ static_assert(!__is_layout_compatible(StructWithAnonUnion, StructWithAnonUnion3) #endif } // namespace cwg2759 +#if __cplusplus >= 202002L +namespace cwg2770 { // cwg2770: 20 +template +struct B { + static_assert(sizeof(T) == 1); + using type = int; +};

[clang] [clang] Minor updates to C++ DR page design (PR #106360)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/106360 This patch updates `make_cxx_dr_status` script to use the same spoiler-like way to hide additional details that `cxx_status.html` uses. This gives implemented yet unresolved DRs new but very familiar look: ![s9

[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

2024-08-28 Thread Vlad Serebrennikov via cfe-commits
@@ -2099,6 +2099,70 @@ class Sema final : public SemaBase { bool CheckCountedByAttrOnField(FieldDecl *FD, Expr *E, bool CountInBytes, bool OrNull); + // AssignmentAction - This is used by all the assignment diagnostic functions + // to repr

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

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

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

2024-08-27 Thread Vlad Serebrennikov via cfe-commits
@@ -6,7 +6,7 @@ // RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected %s // RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected %s -namespace cwg2917 { // cwg2917: 20 open 2024-07-30 +namespace cwg2917 { // cwg2917: 20 review 2024-07-30 Endi

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

2024-08-27 Thread Vlad Serebrennikov via cfe-commits
@@ -17292,43 +17292,43 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/2913.html";>2913 -open +tentatively ready Grammar for deduction-guide has requires-clause in the wrong position Not resolved https

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

2024-08-27 Thread Vlad Serebrennikov via cfe-commits
@@ -6,7 +6,7 @@ // RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected %s // RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected %s -namespace cwg2917 { // cwg2917: 20 open 2024-07-30 +namespace cwg2917 { // cwg2917: 20 review 2024-07-30 Endi

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

2024-08-27 Thread Vlad Serebrennikov via cfe-commits
@@ -33,7 +33,7 @@ void *operator new(std::size_t, void *p) { return p; } void* operator new[] (std::size_t, void* p) {return p;} -namespace cwg2922 { // cwg2922: 20 open 2024-07-10 +namespace cwg2922 { // cwg2922: 20 tentatively ready 2024-07-10 Endilll wrote

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

2024-08-27 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/106299 [CWG2917](https://cplusplus.github.io/CWG/issues/2917.html) got a new proposed resolution that is different from the one the test has been written against. [CWG2922](https://cplusplus.github.io/CWG/issues/2922.

  1   2   3   4   5   6   7   8   9   10   >