* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-data2.C
blob898102167de83a35a34c64c3d3ef88fb0fe311bc
1 // { dg-do compile { target c++11 } }
3 template<typename _Tp, _Tp v>
4   struct A3
5   {
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; }
12   };
14 // Partial specialization.
15 template<typename _Tp, _Tp* v>
16   struct A3<_Tp*, v>
17   {
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; }
24   };
26 // Explicit specialization.
27 template<>
28   struct A3<unsigned short, 0>
29   {
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; }
36   };
38 // Explicitly instantiate.
39 template struct A3<int, 415>;
41 // Extern explicitly instantiate.
42 extern template struct A3<int, 510>;
44 // Use.
45 A3<int, 1111> a31;
46 A3<char, 9999> a32;             // { dg-warning "overflow" }