Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/lambda-uneval16.C

raw
1 // PR c++/101181
2 // { dg-do compile { target c++20 } }
3
4 template<class T,
5 bool = [] () -> bool {
6 if constexpr (requires { typename T::type; })
7 return true;
8 return false;
9 }()>
10 struct p { using type = void; };
11
12 template<class T>
13 struct p<T, true> { using type = typename T::type; };
14
15 template<class T> using P = typename p<T>::type;
16
17 using type1 = P<int>;
18 using type = void;
19
20 struct A { using type = char; };
21 using type2 = P<A>;
22 using type2 = char;