https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127627
Bug ID: 127627
Summary: What's the right overload resolution for ``public:
X(const X&); private: explicit X(const X&) requires
T::value = default;``?
Product: gcc
Version: 16.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: songb432 at gmail dot com
Target Milestone: ---
https://godbolt.org/z/GEW6Y3376
template <class T>
struct X
{
X() = default;
X(const X&) { throw; }
private:
explicit X(const X&) requires (T::value) = default;
};
struct S { static constexpr bool value = true; };
int main()
{
const X<S> x;
X<S> x2 = x;
}
Clang compiles. GCC doesn't. Who's on the right side? I guess it's Clang,
because the two copy constructor is simply `ignored` in GCC. Is it a bug,
seriously?