Debian Codegraph @

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

raw
1 // PR c++/90679
2 // A version of alias-decl-75.C where the specializations of the
3 // complex alias template first_t are dependent.
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<first_t<T, T&>>> {
17 static constexpr int value = 1;
18 };
19
20 template<class T>
21 struct traits<A<first_t<const T, T&>>> {
22 static constexpr int value = 2;
23 };
24
25 static_assert(traits<A<int>>::value == 1, "");
26 static_assert(traits<A<const int>>::value == 2, ""); // { dg-bogus "ambiguous" }