1 // PR c++/83918
2 // { dg-do compile { target c++17 } }
3
4 constexpr unsigned
foo(unsigned x,unsigned y)5 foo (unsigned x, unsigned y)
6 {
7 return x > y ? x : y;
8 }
9
10 template <typename, typename> struct A;
11 template <auto ...> struct B;
12 template <auto S, auto ... T, auto U, auto ... V>
13 struct A <B <S, T...>, B <U, V...>>
14 {
15 enum : unsigned
16 {
17 u = foo (sizeof (S), sizeof (U)),
18 v = A <B <T...>, B <V...>>::w,
19 w = foo (u, v)
20 };
21 };
22
23 template <>
24 struct A <B <>, B <>>
25 {
26 enum : unsigned { w = 0 };
27 };
28
29 constexpr static const auto v { A <B <1,2,3,4,5,6,7,8,9>,
30 B <9,8,7,6,5,4,3,2,1>>::w };
31 static_assert (v == sizeof (int));
32