Debian Codegraph @

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

raw
1 // If the entity is a template parameter object for a template parameter of
2 // type T, the type of the expression is const T.
3
4 // { dg-do compile { target c++20 } }
5
6 template <class T, class U> struct same;
7 template <class T> struct same<T,T> {};
8
9 struct A {
10 int i;
11 // auto operator<=> (const A&) = default;
12 };
13 void f(A&) = delete;
14 void f(const A&) { }
15
16 template < A a > struct B
17 {
18 B()
19 {
20 f(a);
21 same<A,decltype(a)> s;
22 same<const A&,decltype((a))> s2;
23 }
24 };
25
26 B<A{42}> b;