aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/class-deduction92.C
blob: 4920ca4f4a0ebc35928b1c1e0b52dde38086ce0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// PR c++/79501
// { dg-do compile { target c++17 } }

template<auto V>
struct X {
  template<class T, auto>
  struct B { T t; };

  template<class T> B(T, decltype(V)=V) -> B<const T, V>;

  auto foo() { return B{V}; }
};

X<42> x;
using type = decltype(x.foo());
using type = decltype(decltype(x)::B{42});
using type = X<42>::B<const int, 42>;