aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/lambda-uneval16.C
blob: 1113c6f02b9a7890fe15587cdb7ec9d0b35d62c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/101181
// { dg-do compile { target c++20 } }

template<class T,
	 bool = [] () -> bool {
	   if constexpr (requires { typename T::type; })
	     return true;
	   return false;
	 }()>
struct p { using type = void; };

template<class T>
struct p<T, true> { using type = typename T::type; };

template<class T> using P = typename p<T>::type;

using type1 = P<int>;
using type = void;

struct A { using type = char; };
using type2 = P<A>;
using type2 = char;