diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp1z/class-deduction45.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1z/class-deduction45.C | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction45.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction45.C new file mode 100644 index 00000000000..3fe8dd33b79 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction45.C @@ -0,0 +1,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}; +} |