2013-07-26 Paolo Carlini <paolo.carlini@oracle.com>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / pr57101.C
bloba5c4a3c11a6f2cbab16cca64233c29e6a2965a6b
1 // { dg-options "-std=c++11 -fcompare-debug" }
3 typedef long unsigned size_t;
4 namespace
6   template < typename _Tp, _Tp __v > struct integral_constant
7   {
8     static const _Tp value = __v;
9   };
10   typedef integral_constant < bool, false > false_type;
11   template < typename > struct remove_cv;
12   template < typename > struct __is_void_helper:false_type
13   {
14   };
15   template
16     <
17     typename
18     _Tp
19     >
20     struct
21     is_void:integral_constant
22     < bool, (__is_void_helper < typename remove_cv < _Tp >::type >::value) >
23   {
24   };
25   template < typename > struct is_function:false_type
26   {
27   };
28   template < typename _Tp > struct remove_const
29   {
30     typedef _Tp type;
31   };
32   template < typename _Tp > struct remove_volatile
33   {
34     typedef _Tp type;
35   };
36   template < typename _Tp > struct remove_cv
37   {
38     typedef
39       typename
40       remove_const < typename remove_volatile < _Tp >::type >::type type;
41   };
42   template < typename > struct is_lvalue_reference:false_type
43   {
44   };
45   template < typename _Tp, bool = is_void < _Tp >::value > struct __add_rvalue_reference_helper
46   {
47     typedef _Tp type;
48   };
49   template
50     <
51     typename
52     _Tp > struct add_rvalue_reference:__add_rvalue_reference_helper < _Tp >
53   {
54   };
55   template
56     < typename _Tp > typename add_rvalue_reference < _Tp >::type declval ();
57   template
58     <
59     typename,
60     typename
61     _To, bool = (is_function < _To >::value) > struct __is_convertible_helper;
62   template
63     <
64     typename
65     _From, typename _To > struct __is_convertible_helper <_From, _To, false >
66   {
67     static const bool __value = sizeof ((declval < _From > ()));
68   };
69   template
70     <
71     typename
72     _From,
73     typename
74     _To
75     >
76     struct
77     is_convertible:integral_constant
78     < bool, __is_convertible_helper < _From, _To >::__value >
79   {
80   };
81   template < bool, typename _Tp = void >struct enable_if
82   {
83     typedef _Tp type;
84   };
85   template < typename _Tp > struct identity
86   {
87     typedef _Tp type;
88   };
89   template
90     <
91     typename
92     _Tp
93     >
94     typename
95     enable_if
96     <
97     is_lvalue_reference
98     < _Tp >::value, _Tp >::type forward (typename identity < _Tp >::type)
99   {
100     return 0;
102   }
103   template < class _T1, class > struct pair
104   {
105     _T1 first;
106     template < class _U1, class = typename enable_if < is_convertible < _U1, _T1 >::value >::type > pair (_U1 __x):
107     first
108       (forward < _U1 > (__x))
109     {
110     }
111   };
114 namespace __gnu_cxx
116   template < typename > class new_allocator
117   {
118   };
121 namespace std
123   template < typename _Tp > class allocator:__gnu_cxx::new_allocator < _Tp >
124   {
125   public:
126     template < typename > struct rebind
127     {
128       typedef allocator other;
129     };
130   };
131   template < typename, typename > struct unary_function;
132   template < typename, typename, typename > struct binary_function
133   {
134   };
135   template < typename _Tp > struct less:binary_function < _Tp, _Tp, bool >
136   {
137   };
138   template
139     <
140     typename
141     _Pair
142     > struct _Select1st:unary_function < _Pair, typename _Pair::first_type >
143   {
144   };
145   template < typename > struct _Rb_tree_node;
146   template
147     <
148     typename,
149     typename
150     _Val,
151     typename,
152     typename _Compare, typename _Alloc = allocator < _Val > >class _Rb_tree
153   {
154     typedef
155       typename
156       _Alloc::template
157       rebind < _Rb_tree_node < _Val > >::other _Node_allocator;
158   public:
159     typedef _Alloc allocator_type;
160     template < typename _Key_compare > struct _Rb_tree_impl
161     {
162       _Rb_tree_impl (_Key_compare, _Node_allocator);
163     };
164     _Rb_tree_impl < _Compare > _M_impl;
165   _Rb_tree (_Compare __comp, allocator_type __a):
166     _M_impl (__comp, __a)
167     {
168     }
169   };
170   template < class _E > class initializer_list
171   {
172     typedef size_t size_type;
173     typedef _E *iterator;
174     iterator _M_array;
175     size_type _M_len;
176   };
177   template
178     <
179     typename
180     _Key,
181     typename
182     _Tp,
183     typename
184     _Compare
185     =
186     less
187     <
188     _Key >, typename _Alloc = allocator < pair < _Key, _Tp > > >class multimap
189   {
190     typedef _Key key_type;
191     typedef pair < _Key, _Tp > value_type;
192     typedef _Compare key_compare;
193     typedef _Alloc allocator_type;
194     typedef
195       _Rb_tree
196       <
197       key_type,
198       value_type, _Select1st < value_type >, key_compare > _Rep_type;
199     _Rep_type _M_t;
200   public:
201   multimap (initializer_list < value_type >, _Compare __comp = _Compare (), allocator_type __a = allocator_type ()):
202     _M_t
203       (__comp, __a)
204     {
205     }
206   };
209 using namespace std;
210 void
211 test01 ()
213   typedef multimap < int, double >Container;
214   Container (
215               {
216               {
217               1}
218               }
219   );