Issue |
96408
|
Summary |
Cannot use lambda _expression_ within Requires
|
Labels |
new issue
|
Assignees |
|
Reporter |
Fedr
|
This program
```
template<typename T>
concept C = requires(T t) {
[x=t](){ return x; }();
};
static_assert(C<int>);
```
seems valid, and it is accepted by GCC and MSVC. Unfortunately, Clang rejects it with the
```
error: constraint variable 't' cannot be used in an evaluated context
3 | [x=t](){ return x; }();
```
Online demo: https://gcc.godbolt.org/z/37v5bWKvv
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs