Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/nontype-class53.C

raw
1 // PR c++/103346
2 // { dg-do compile { target c++20 } }
3
4 struct Item {};
5
6 template<class T, T... ts>
7 struct Sequence { };
8
9 template<Item... items>
10 using ItemSequence = Sequence<Item, items...>;
11
12 template<Item... items>
13 constexpr auto f() {
14 constexpr auto l = [](Item item) { return item; };
15 return ItemSequence<l(items)...>{};
16 }
17
18 using ty0 = decltype(f<>());
19 using ty0 = ItemSequence<>;
20
21 using ty1 = decltype(f<{}>());
22 using ty1 = ItemSequence<{}>;
23
24 using ty3 = decltype(f<{}, {}, {}>());
25 using ty3 = ItemSequence<{}, {}, {}>;