Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/class-deduction45.C

raw
1 // PR c++/82308
2 // { dg-do compile { target c++17 } }
3
4 template<typename, unsigned>
5 struct array {};
6
7 template <unsigned R>
8 class X {
9 public:
10 using T = array<int, R>;
11
12 enum class C : char { A, B };
13 X(T bounds, C c = C::B) : t(bounds) {}
14
15 private:
16 T t;
17 };
18
19 int main()
20 {
21 array<int, 2> a;
22 X d{a};
23 X<2> e{a};
24 }