aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias20.C
blob: 8cc56d91e37044d0fb8fefa8f85161667e1b9655 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/114901
// { dg-do compile { target c++20 } }

template <class D>
constexpr bool C = sizeof(D);

template <typename U>
struct T {
  template<typename V, typename N>
  struct Foo {
    Foo(V, N);
  };

  template<typename X, typename N>
  requires (C<N>) // removes the require-clause will make the crash disappear
  Foo(X, N) -> Foo<X, N>;

  template <typename Y, typename Y2, int N = sizeof(Y2)>
  using AFoo = Foo<decltype(N), Y2>;
};

T<double>::AFoo s{1, 2}; // { dg-error "deduction|no match" }