1 // Testcase from P2308R1
2 // { dg-do compile { target c++20 } }
4 template<auto n> struct B { /* ... */ };
5 B<5> b1; // OK, template parameter type is int
6 B<'a'> b2; // OK, template parameter type is char
7 B<2.5> b3; // OK, template parameter type is double
8 B<void(0)> b4; // { dg-error "void" }
10 template<int i> struct C { /* ... */ };
16 B<J1{}> j1; // { dg-error "not a constant expression" }
21 constexpr J2(const J2&) {}
23 B<J2{}> j2; // { dg-error "" }