Issue 63808
Summary [clang 16 & trunk][c++20] Crash when mixing iterator concepts and using-declarations in a requires _expression_
Labels new issue
Assignees
Reporter octurion
    After drawing some inspiration from [this Stackoverflow answer](https://stackoverflow.com/a/74659822), I decided to write up the following code that checks the presence of `begin()` and `end()` via ADL:

```
#include <concepts>
#include <iterator>
#include <vector>

template <typename T>
concept HasBeginEnd = []{
 using std::begin;
    using std::end;

    return requires(T& t)
 {
        {begin(t)} -> std::input_iterator;
        {end(t)} -> std::input_iterator;
 };
}();
static_assert(HasBeginEnd<std::vector<int>>);
```

This, however, crashes Clang 16 and trunk on Godbolt. Surprisingly, it appears that Clang 15 and older are not affected.

Godbolt link: https://godbolt.org/z/zndsGP63Y

Stacktrace generated: [stacktrace.txt](https://github.com/llvm/llvm-project/files/12016860/stacktrace.txt)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to