[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-07-15 Thread via cfe-commits
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-07-12 Thread via cfe-commits
@@ -4845,6 +4845,61 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // Check for auto functions and trailing return type and adjust the // return type accordingly. if (!D.isInvalidType()) { +auto IsClassType = [&](CXXSco

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-07-12 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM modulo nit Thanks for working on this https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-07-12 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-07-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM -- @cor3ntin, are you happy with the changes as well? https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-07-03 Thread via cfe-commits
Sirraide wrote: ping https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-06-27 Thread via cfe-commits
Sirraide wrote: ping https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/89078 >From c611122688657287e8285edd9a2875e4975d26dd Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 17 Apr 2024 16:15:39 +0200 Subject: [PATCH 01/12] [Clang] Disallow explicit object parameters in more contexts

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-06-19 Thread via cfe-commits
@@ -7525,6 +7525,8 @@ def err_explicit_object_parameter_mutable: Error< def err_invalid_explicit_object_type_in_lambda: Error< "invalid explicit object parameter type %0 in lambda with capture; " "the type must be the same as, or derived from, the lambda">; +def err_explici

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-06-19 Thread via cfe-commits
@@ -11463,6 +11463,23 @@ void Sema::CheckExplicitObjectMemberFunction(Declarator &D, D.setInvalidType(); } + // Handle the following case: + // + // struct S { + // struct T { + // int f(this T); + // }; + // + // friend int T::f(this T); // Allow this

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-06-19 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/89078 >From c611122688657287e8285edd9a2875e4975d26dd Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 17 Apr 2024 16:15:39 +0200 Subject: [PATCH 01/11] [Clang] Disallow explicit object parameters in more contexts

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -11463,6 +11463,23 @@ void Sema::CheckExplicitObjectMemberFunction(Declarator &D, D.setInvalidType(); } + // Handle the following case: + // + // struct S { + // struct T { + // int f(this T); + // }; + // + // friend int T::f(this T); // Allow this

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread via cfe-commits
@@ -11463,6 +11463,23 @@ void Sema::CheckExplicitObjectMemberFunction(Declarator &D, D.setInvalidType(); } + // Handle the following case: + // + // struct S { + // struct T { + // int f(this T); + // }; + // + // friend int T::f(this T); // Allow this

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread via cfe-commits
@@ -11463,6 +11463,23 @@ void Sema::CheckExplicitObjectMemberFunction(Declarator &D, D.setInvalidType(); } + // Handle the following case: + // + // struct S { + // struct T { + // int f(this T); + // }; + // + // friend int T::f(this T); // Allow this

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/89078 >From c611122688657287e8285edd9a2875e4975d26dd Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 17 Apr 2024 16:15:39 +0200 Subject: [PATCH 01/10] [Clang] Disallow explicit object parameters in more contexts

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread via cfe-commits
@@ -4845,6 +4845,55 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // Check for auto functions and trailing return type and adjust the // return type accordingly. if (!D.isInvalidType()) { +auto isClassType = [&](CXXSco

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread via cfe-commits
@@ -7525,6 +7525,8 @@ def err_explicit_object_parameter_mutable: Error< def err_invalid_explicit_object_type_in_lambda: Error< "invalid explicit object parameter type %0 in lambda with capture; " "the type must be the same as, or derived from, the lambda">; +def err_explici

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -4845,6 +4845,55 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // Check for auto functions and trailing return type and adjust the // return type accordingly. if (!D.isInvalidType()) { +auto isClassType = [&](CXXSco

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -7525,6 +7525,8 @@ def err_explicit_object_parameter_mutable: Error< def err_invalid_explicit_object_type_in_lambda: Error< "invalid explicit object parameter type %0 in lambda with capture; " "the type must be the same as, or derived from, the lambda">; +def err_explici

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-28 Thread Aaron Ballman via cfe-commits
@@ -4845,6 +4845,55 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // Check for auto functions and trailing return type and adjust the // return type accordingly. if (!D.isInvalidType()) { +auto isClassType = [&](CXXSco

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-27 Thread via cfe-commits
Sirraide wrote: ping https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-20 Thread via cfe-commits
Sirraide wrote: CI failure before seems to have been due to us running out of memory compiling flang from what I can tell? https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-05-20 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/89078 >From c611122688657287e8285edd9a2875e4975d26dd Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 17 Apr 2024 16:15:39 +0200 Subject: [PATCH 1/9] [Clang] Disallow explicit object parameters in more contexts --

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-23 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/89078 >From c611122688657287e8285edd9a2875e4975d26dd Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 17 Apr 2024 16:15:39 +0200 Subject: [PATCH 1/9] [Clang] Disallow explicit object parameters in more contexts --

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-23 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/89078 >From c611122688657287e8285edd9a2875e4975d26dd Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 17 Apr 2024 16:15:39 +0200 Subject: [PATCH 1/8] [Clang] Disallow explicit object parameters in more contexts --

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-23 Thread via cfe-commits
Sirraide wrote: Alright, it took me a bit, but I’ve figured out how to continue issuing the ‘... cannot appear in a non-member function’ diagnostic where appropriate. This also handles `friend` declarations now because I had forgotten about that; I’ve also added a few more tests for declaratio

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-23 Thread via cfe-commits
@@ -5,7 +5,7 @@ void f(this); // expected-error{{variable has incomplete type 'void'}} \ // expected-error{{invalid use of 'this' outside of a non-static member function}} -void g(this auto); // expected-error{{an explicit object parameter cannot appear in a no

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-23 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/89078 >From c611122688657287e8285edd9a2875e4975d26dd Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 17 Apr 2024 16:15:39 +0200 Subject: [PATCH 1/7] [Clang] Disallow explicit object parameters in more contexts --

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-23 Thread via cfe-commits
https://github.com/Sirraide updated https://github.com/llvm/llvm-project/pull/89078 >From c611122688657287e8285edd9a2875e4975d26dd Mon Sep 17 00:00:00 2001 From: Sirraide Date: Wed, 17 Apr 2024 16:15:39 +0200 Subject: [PATCH 1/6] [Clang] Disallow explicit object parameters in more contexts --

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread via cfe-commits
Sirraide wrote: > I'm going to merge #88974 shortly, but I don't think this interferes with > anything here Yeah, it seems orthogonal to this patch from what I can tell at least. https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I'm going to merge #88974 shortly, but I don't think this interferes with anything here https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread via cfe-commits
Sirraide wrote: > Note this PR is related to > https://github.com/llvm/llvm-project/pull/88974/files That’s pr covers a different code path from what I can tell though (unless requires expressions are also modelled as function declarators, I’m honestly not sure about that one). It also remind

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread via cfe-commits
@@ -5287,6 +5287,36 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // Check for auto functions and trailing return type and adjust the // return type accordingly. if (!D.isInvalidType()) { +// [dcl.fct]p6: +// +

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread via cfe-commits
@@ -5,7 +5,7 @@ void f(this); // expected-error{{variable has incomplete type 'void'}} \ // expected-error{{invalid use of 'this' outside of a non-static member function}} -void g(this auto); // expected-error{{an explicit object parameter cannot appear in a no

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread via cfe-commits
@@ -5287,6 +5287,36 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // Check for auto functions and trailing return type and adjust the // return type accordingly. if (!D.isInvalidType()) { +// [dcl.fct]p6: +// +

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread via cfe-commits
https://github.com/cor3ntin commented: Generally, I like the approach. Note this PR is related to https://github.com/llvm/llvm-project/pull/88974/files @sdkrystian https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-com

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/89078 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (Sirraide) Changes [[dcl.fct]p6](https://eel.is/c++draft/dcl.fct#6) states: > [...] An explicit-object-parameter-declaration shall appear only as the first parameter-declaration of a parameter-declaration-list of either: > - a member

[clang] [Clang] Disallow explicit object parameters in more contexts (PR #89078)

2024-04-17 Thread via cfe-commits
https://github.com/Sirraide created https://github.com/llvm/llvm-project/pull/89078 [[dcl.fct]p6](https://eel.is/c++draft/dcl.fct#6) states: > [...] An explicit-object-parameter-declaration shall appear only as the first > parameter-declaration of a parameter-declaration-list of either: > - a