summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/class-deduction45.C
blob: 3fe8dd33b79745b8f2fdff2e801f6746f3efd31c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// PR c++/82308
// { dg-options -std=c++17 }

template<typename, unsigned>
struct array {};

template <unsigned R>
class X {
public:
  using T = array<int, R>;

  enum class C : char { A, B };
  X(T bounds, C c = C::B) : t(bounds) {}

private:
  T t;
};

int main()
{
  array<int, 2> a;
  X    d{a};
  X<2> e{a};
}