Debian Codegraph @

gcc/testsuite/g++.dg/cpp23/range-for10.C

raw
1 // PR c++/120684
2 // { dg-do compile { target c++20 } }
3
4 struct basic_string {
5 constexpr ~basic_string() {}
6 };
7 template <typename _Vp> struct lazy_split_view {
8 _Vp _M_base;
9 constexpr int* begin() { return nullptr; }
10 constexpr int* end() { return nullptr; }
11 };
12 constexpr void test_with_piping() {
13 basic_string input;
14 for (auto e : lazy_split_view(input))
15 ;
16 }
17 constexpr bool main_test() {
18 test_with_piping();
19 test_with_piping();
20 return true;
21 }
22 //int main() { main_test(); }
23 static_assert(main_test());