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
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
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
@@ -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
@@ -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.
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
@@ -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
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
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
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
@@ -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
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
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
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
@@ -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
@@ -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
@@ -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
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
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 --
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,
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,
21 matches
Mail list logo