blob: 725e758018fb8d2ac7401cfc89f81a4cef9c5857 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// PR c++/104470
// { dg-do compile { target c++20 } }
template<typename _Types>
class variant
{
template<typename _Tp>
static constexpr int __accepted_index = 0;
template<int _Np>
using __to_type = int;
template<typename _Tp>
using __accepted_type = __to_type<__accepted_index<_Tp>>;
template<typename _Tp, typename _Tj = __accepted_type<_Tp>>
variant(_Tp __t) { }
};
template <typename T>
struct Foo
{
T value;
};
template <typename T>
using V = variant<Foo<T>>;
V e = Foo{1}; // { dg-error "" }
|