Debian Codegraph @

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

raw
1 // PR c++/90679
2 // { dg-do compile { target c++11 } }
3
4 template<class T, class...>
5 using first_t = T;
6
7 template<class T>
8 struct A;
9
10 template<class T>
11 struct traits;
12
13 template<class T>
14 struct traits<A<first_t<T>>> {
15 static constexpr int value = 1;
16 };
17
18 template<class T>
19 struct traits<A<first_t<const T>>> {
20 static constexpr int value = 2;
21 };
22
23 static_assert(traits<A<int>>::value == 1, "");
24 static_assert(traits<A<const int>>::value == 2, ""); // { dg-bogus "ambiguous" }