2 // { dg-additional-options "-Wno-return-type" }
4 template <typename> class A;
5 template <typename _Tp> using __allocator_base = _Tp;
6 template <class T, class = T, class = int, class = __allocator_base<int>>
8 template <class T, class H, class P, class A>
9 bool operator==(B<T, H, P, A> const &, B<T, H, P, A> const &);
10 template <class T, class H, class P, class A>
11 bool operator!=(B<T, H, P, A> const &, B<T, H, P, A> const &);
12 typedef B<int> int_multiset;
14 template <typename> struct C {
17 template <typename> struct D;
18 template <typename> struct K;
19 struct L : C<A<D<int>>>, C<A<K<int>>> {
20 template <typename First, typename Second>
22 : C<A<D<int>>>(0), C<A<K<int>>>(0) {}
24 template <typename Node> struct F {
25 typedef typename Node::node_pointer node_pointer;
28 F(typename Node::link_pointer p1) : node_(static_cast<node_pointer>(p1)) {}
29 void operator++() { node_ = 0; }
30 int operator!=(F p1) { return node_ != p1.node_; }
33 typedef G *link_pointer;
36 static int new_bucket_count(int) {
46 functions(int, int) {}
49 template <typename Types> struct table : functions {
50 typedef typename Types::policy policy;
51 typedef Types node_allocator;
52 typedef F<typename Types::node> iterator;
56 typename Types::link_pointer get_previous_start() const;
57 iterator begin() const { return size_ ? get_previous_start() : 0; }
58 table(int, typename Types::hasher, typename Types::key_equal, node_allocator)
59 : functions(0, 0), allocators_(0, 0),
60 bucket_count_(policy::new_bucket_count(0)), size_() {}
62 template <typename> struct K : G { typedef K *node_pointer; };
64 typedef G *link_pointer;
67 typedef I::link_pointer link_pointer;
69 template <typename> struct D {
71 typedef int key_equal;
73 typedef J::link_pointer link_pointer;
76 struct M : table<D<int>> {
77 node_allocator grouped_table_impl_a;
78 M(int, int) : table(0, 0, 0, grouped_table_impl_a) {}
79 void equals(M const &) const {
80 for (iterator d = begin(); d.node_;) {
85 static int group_equals(iterator p1) {
95 template <class, class, class, class> class B {
100 friend bool operator==<>(B const &, B const &);
101 friend bool operator!=<>(B const &, B const &);
103 template <class T, class H, class P, class A>
104 B<T, H, P, A>::B(unsigned long)
106 template <class T, class H, class P, class A>
107 bool operator==(B<T, H, P, A> const &p1, B<T, H, P, A> const &p2) {
108 p1.table_.equals(p2.table_);
110 template <class T, class H, class P, class A>
111 bool operator!=(B<T, H, P, A> const &p1, B<T, H, P, A> const &p2) {
112 p1.table_.equals(p2.table_);
114 void use_multiset_fwd_declared_function_typerun() {