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
@@ -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
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
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
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
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
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
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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
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
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
--
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
--
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
--
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
@@ -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
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
--
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
--
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
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
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
@@ -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:
+//
+
@@ -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
@@ -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:
+//
+
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
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
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
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
39 matches
Mail list logo