Created on 2026-09-30.00:00:00 last changed yesterday
Possible resolution:
Change in 11.4.4 [special] paragraph 6 as follows:
An eligible special member function is a special member function for which:
- the function is not deleted,
- the associated constraints (13.5 [temp.constr]), if any, are satisfied, and
- no special member function of the same kind and at most as explict (9.2.3 [dcl.fct.spec]) whose associated constraints, if any, are satisfied is more constrained (13.5.5 [temp.constr.order])
.,where a function F1 is at most as explicit as a function F2 if
- both are explicit or neither is or
- F1 is not explicit and F2 is explicit.
Consider:
template <class T>
struct X {
X() = default;
X(const X&) = default;
private:
explicit X(const X&) requires (T::value) = default; // #1
};
struct S { static constexpr bool value = true; };
int main() {
const X<S> x;
X<S> x2 = x; // #2
}
According to 11.4.4 [special] paragraph 6, the public copy constructor is not eligible, because #1 is more constrained. This causes it to be deleted (9.6.2 [dcl.fct.def.default] paragraph 5). Yet, the public copy constructor is selected by overload resolution when used at #2.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-09-30 19:11:00 | admin | set | messages: + msg8689 |
| 2026-09-30 00:00:00 | admin | create | |