https://bugs.llvm.org/show_bug.cgi?id=44657
Bug ID: 44657
Summary: Rejects valid code with requires clause accepting bool
expression on copy / move
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++2a
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
The following code
```
template<typename>
constexpr bool true_ = true;
template<typename Ts>
struct s {
s(int)
{
}
s(s const &) requires(true_<Ts>) {}
};
auto v = s<int>(5);
```
Outputs
```
main.cpp:11:24: error: substitution into constraint expression resulted in a
non-constant expression
s(s const &) requires(true_<Ts>) {}
^~~~~~~~~
main.cpp:11:24: note: subexpression not valid in a constant expression
1 error generated.
```
When compiled with `clang++ -std=c++2a -o /dev/null -c main.cpp`
The error goes away if I define `true_` as a concept rather than a bool. This
seems to apply only to copy / move constructors / assignment operators.
--
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