1 // { dg-do compile { target c++11 } }
3 template<typename _Tp, _Tp v>
6 typedef _Tp value_type;
7 typedef A3<value_type,v> type;
9 static constexpr value_type value = v;
11 constexpr operator value_type() { return value; }
14 // Partial specialization.
15 template<typename _Tp, _Tp* v>
18 typedef _Tp* value_type;
19 typedef A3<value_type,v> type;
21 static constexpr value_type value = v;
23 constexpr operator value_type() { return value; }
26 // Explicit specialization.
28 struct A3<unsigned short, 0>
30 typedef unsigned short value_type;
31 typedef A3<value_type, 0> type;
33 static constexpr value_type value = 0;
35 constexpr operator value_type() { return value; }
38 // Explicitly instantiate.
39 template struct A3<int, 415>;
41 // Extern explicitly instantiate.
42 extern template struct A3<int, 510>;
46 A3<char, 9999> a32; // { dg-error "narrowing conversion" }