https://bugs.llvm.org/show_bug.cgi?id=46269
Bug ID: 46269
Summary: Only first destructor is considered when constraints
are used
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++2a
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
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.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs