Extended Description
When there are multiple destructors constrained with a requires clause, only the first one is considered, like in the following code:
template <bool B>
struct A {
~A() requires (B) { }
~A() requires (!B) { }
};
A<false> x;
The compiler reports the following error:
<source>:7:10: error: invalid reference to function '~A': constraints not satisfied
A<false> x;
^
<source>:3:20: note: because 'false' evaluated to false
~A() requires (B) { }
^
The compiler prematurely reports an error about an invalid reference to the destructor because the constraint on the first variant was not satisfied, without checking the second variant.
The same code compiles with GCC without any problems.
Extended Description
When there are multiple destructors constrained with a requires clause, only the first one is considered, like in the following code:
The compiler reports the following error:
The compiler prematurely reports an error about an invalid reference to the destructor because the constraint on the first variant was not satisfied, without checking the second variant.
The same code compiles with GCC without any problems.