Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/alias-decl-75b.C

raw
1 // PR c++/90679
2 // A version of alias-decl-75a.C where the alias template specialization
3 // appears as a more deeply nested template argument.
4 // { dg-do compile { target c++11 } }
5
6 template<class T, class...>
7 using first_t = T;
8
9 template<class T>
10 struct A;
11
12 template<class T>
13 struct traits;
14
15 template<class T>
16 struct traits<A<A<first_t<T, T&>>>> {
17 static constexpr int value = 1;
18 };
19
20 template<class T>
21 struct traits<A<A<first_t<const T, T&>>>> {
22 static constexpr int value = 2;
23 };
24
25 static_assert(traits<A<A<int>>>::value == 1, "");
26 static_assert(traits<A<A<const int>>>::value == 2, ""); // { dg-bogus "ambiguous" }