Debian Codegraph @

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

raw
1 // PR c++/92948 - Fix class NTTP with template arguments.
2 // { dg-do compile { target c++20 } }
3
4 struct A {
5 constexpr A(int) { }
6 };
7
8 template<A>
9 struct B {
10 using U = unsigned;
11 };
12
13 template<A a>
14 using U = B<a>;
15
16 template<int X, typename Y = typename B<X>::U>
17 void foo()
18 {
19 }
20
21 template<int X, typename Y = typename U<X>::U>
22 void foo2()
23 {
24 }
25
26 template<typename Y = typename B<1>::U>
27 void foo3()
28 {
29 }
30
31 void
32 g ()
33 {
34 foo<1>();
35 foo2<1>();
36 foo3<>();
37 }