aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/class-deduction-alias2.C
blob: d855f7d11ce9e56a5eb35ea90742a7a62609a3d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Test that a non-template deduction guide that doesn't match the alias is
// ignored.
// { dg-do compile { target c++2a } }

template <class T> struct identity { using type = T; };
template <class T> using identity_t = typename identity<T>::type;

template <class T, class U> struct C {
  C(T, U);			// #1
};

C(char*, char*) -> C<int,int>;  // #3

template<class V>
using A = C<V *, V *>;

char c;
A a4 (&c, &c);			// ignores #3 because C<int,int> is not an A<V>

static_assert (__is_same_as(decltype(a4),A<char>));

C c2 (&c, &c);			// { dg-error "conversion" } deduces with #3