Debian Codegraph @

gcc/testsuite/g++.dg/template/pr99425.C

raw
1 // { dg-do compile { target c++20 } }
2 // a potential fix for 99425 generated an ICE here.
3
4 template<typename _Tp>
5 struct is_nothrow_destructible;
6
7 template<typename _Tp>
8 struct common_reference;
9
10 template<typename _Tp>
11 concept same_as
12 = true;
13
14 template<typename _Sent, typename _Iter>
15 concept sentinel_for
16 = same_as<common_reference<_Sent>>
17 && is_nothrow_destructible<_Iter>::value;
18
19 template<typename _Tp>
20 concept __member_end
21 = requires (_Tp& __t)
22 {
23 { true }
24 -> sentinel_for<decltype(__t)>;
25 };
26
27 template<typename _Tp>
28 concept __adl_end
29 = requires (_Tp& __t)
30 {
31 { true }
32 -> sentinel_for<decltype(__t)>;
33 };
34
35 template<typename _Tp>
36 requires __member_end<_Tp> || __adl_end<_Tp>
37 void
38 Bar (_Tp&& __t)
39 {
40 }
41
42 void test03 ()
43 {
44 Bar (1); // { dg-error "no matching function" }
45 }