[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-30 Thread via cfe-commits
https://github.com/cor3ntin closed https://github.com/llvm/llvm-project/pull/70176 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-30 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/70176 >From bd24d172c3ea66909748dca00fa368a7e4e9c358 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 25 Oct 2023 10:08:24 +0200 Subject: [PATCH 1/3] [Clang] Diagnose defaulted assignment operator with

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-30 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM though something seems to be amiss with precommit CI and so it might be nice to get a clean run of that before landing (I don't insist). https://github.com/llvm/llvm-project/pull/70176

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-30 Thread Aaron Ballman via cfe-commits
@@ -7748,6 +7748,24 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD, HadError = true; } } +// [C++23][dcl.fct.def.default]/p2.2 AaronBallman wrote: Oh! I was thinking that spaceship was also a special member

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-30 Thread via cfe-commits
@@ -7748,6 +7748,24 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD, HadError = true; } } +// [C++23][dcl.fct.def.default]/p2.2 cor3ntin wrote: It applies to special member functions - Which excludes comparison.

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > Per https://eel.is/c++draft/dcl.fct.def.default#2.2, the explicit object > > > parameter of a defaulted special member function must be of the same type > > > as the one of an equivalent implicitly defaulted function, ignoring > > > references. > > > > > > I could

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-30 Thread Aaron Ballman via cfe-commits
@@ -7748,6 +7748,24 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD, HadError = true; } } +// [C++23][dcl.fct.def.default]/p2.2 AaronBallman wrote: This requirement seems to be a general one but you've implemented

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-30 Thread via cfe-commits
cor3ntin wrote: > > Per https://eel.is/c++draft/dcl.fct.def.default#2.2, the explicit object > > parameter of a defaulted special member function must be of the same type > > as the one of an equivalent implicitly defaulted function, ignoring > > references. > > I could use an explanation as

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-30 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Per https://eel.is/c++draft/dcl.fct.def.default#2.2, the explicit object > parameter of a defaulted special member function must be of the same type as > the one of an equivalent implicitly defaulted function, ignoring references. I could use an explanation as to how

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-28 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/70176 >From 9b559ac5504593ab7aa21539b49ece7eea944eb5 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 25 Oct 2023 10:08:24 +0200 Subject: [PATCH 1/3] [Clang] Diagnose defaulted assignment operator with

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-27 Thread Shafik Yaghmour via cfe-commits
@@ -585,3 +585,34 @@ class Server : public Thing { S name_; }; } + +namespace GH69233 { +struct Base {}; +struct S : Base { +int j; +S& operator=(this Base& self, const S&) = default; +// expected-warning@-1 {{explicitly defaulted copy assignment operator is

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-26 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/70176 >From 9b559ac5504593ab7aa21539b49ece7eea944eb5 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 25 Oct 2023 10:08:24 +0200 Subject: [PATCH 1/2] [Clang] Diagnose defaulted assignment operator with

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-26 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/70176 >From 9b559ac5504593ab7aa21539b49ece7eea944eb5 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 25 Oct 2023 10:08:24 +0200 Subject: [PATCH 1/3] [Clang] Diagnose defaulted assignment operator with

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-26 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/70176 >From 9b559ac5504593ab7aa21539b49ece7eea944eb5 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 25 Oct 2023 10:08:24 +0200 Subject: [PATCH 1/2] [Clang] Diagnose defaulted assignment operator with

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-26 Thread Timm Baeder via cfe-commits
@@ -7748,6 +7748,24 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD, HadError = true; } } +// [C++23][dcl.fct.def.default]/p2.2 +// if F2 has an implicit object parameter of type “reference to C”, +// F1 may be an explicit

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-26 Thread via cfe-commits
@@ -7748,6 +7748,24 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD, HadError = true; } } +// [C++23][dcl.fct.def.default]/p2.2 +// if F2 has an implicit object parameter of type “reference to C”, +// F1 may be an explicit

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-25 Thread Timm Baeder via cfe-commits
@@ -7748,6 +7748,24 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD, HadError = true; } } +// [C++23][dcl.fct.def.default]/p2.2 +// if F2 has an implicit object parameter of type “reference to C”, +// F1 may be an explicit

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-25 Thread via cfe-commits
https://github.com/cor3ntin updated https://github.com/llvm/llvm-project/pull/70176 >From 6fd05adec162b2d18b4b163cc0a0f6d6e6710139 Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Wed, 25 Oct 2023 10:08:24 +0200 Subject: [PATCH] [Clang] Diagnose defaulted assignment operator with

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-25 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff a7700985577694d6cc2498833f27b4fb5eeaf252 441f24714729f35588487d3109e3c42d59e0a610 --

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: cor3ntin (cor3ntin) Changes Per https://eel.is/c++draft/dcl.fct.def.default#2.2, the explicit object parameter of a defaulted special member function must be of the same type as the one of an equivalent implicitly defaulted function,

[clang] [Clang] Diagnose defaulted assignment operator with incompatible object parameter (PR #70176)

2023-10-25 Thread via cfe-commits
https://github.com/cor3ntin created https://github.com/llvm/llvm-project/pull/70176 Per https://eel.is/c++draft/dcl.fct.def.default#2.2, the explicit object parameter of a defaulted special member function must be of the same type as the one of an equivalent implicitly defaulted function,