1 // { dg-do compile }
2 // { dg-additional-options "-Wno-return-type" }
3
4 namespace std {
5 typedef long unsigned int size_t;
6 template<typename> class allocator;
7 template<class _CharT> struct char_traits;
8 template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_string;
9 typedef basic_string<char> string;
10 }
11 namespace std __attribute__ ((__visibility__ ("default"))) {
12 }
13 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
14 }
15 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
16 template<typename _Tp> class new_allocator {
17 };
18 }
19 namespace std __attribute__ ((__visibility__ ("default"))) {
20 template<typename _Tp> class allocator: public __gnu_cxx::new_allocator<_Tp> {
21 public:
22 template<typename _Tp1> struct rebind {
23 typedef allocator<_Tp1> other;
24 };
25 };
26 }
27 namespace std {
28 }
29 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
30 }
31 namespace std __attribute__ ((__visibility__ ("default"))) {
32 template<typename _CharT, typename _Traits, typename _Alloc> class basic_string {
33 struct _Alloc_hider : _Alloc {
_Alloc_hider_Alloc_hider34 _Alloc_hider(_CharT* __dat, const _Alloc& __a) : _Alloc(__a), _M_p(__dat) {
35 }
36 _CharT* _M_p;
37 };
38 mutable _Alloc_hider _M_dataplus;
39 public:
40 basic_string(const _CharT* __s, const _Alloc& __a = _Alloc());
41 };
42 template<typename _CharT, typename _Traits, typename _Alloc> inline bool operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs, const _CharT* __rhs) {
43 }
44 }
45 extern "C" {
46 }
47 namespace std __attribute__ ((__visibility__ ("default"))) {
48 namespace __detail {
49 struct _List_node_base {
50 _List_node_base* _M_next;
51 };
52 }
53 template<typename _Tp> struct _List_node : public __detail::_List_node_base {
54 };
55 template<typename _Tp> struct _List_iterator {
56 typedef _List_iterator<_Tp> _Self;
57 typedef _Tp& reference;
58 reference operator*() const {
59 }
60 bool operator!=(const _Self& __x) const {
61 }
62 };
63 template<typename _Tp, typename _Alloc> class _List_base {
64 protected:
65 typedef typename _Alloc::template rebind<_List_node<_Tp> >::other _Node_alloc_type;
66 struct _List_impl : public _Node_alloc_type {
67 __detail::_List_node_base _M_node;
_List_impl_List_impl68 _List_impl() : _Node_alloc_type(), _M_node() {
69 }
_List_impl_List_impl70 _List_impl(const _Node_alloc_type& __a) : _Node_alloc_type(__a), _M_node() {
71 }
72 };
73 _List_impl _M_impl;
~_List_base()74 ~_List_base() {
75 }
76 void _M_clear();
77 };
78 template<typename _Tp, typename _Alloc = std::allocator<_Tp> > class list : protected _List_base<_Tp, _Alloc> {
79 typedef _List_iterator<_Tp> iterator;
80 typedef size_t size_type;
81 public:
begin()82 iterator begin() {
83 }
end()84 iterator end() {
85 }
empty()86 bool empty() const {
87 }
size()88 size_type size() const {
89 }
swap(list & __x)90 void swap(list& __x) {
91 }
92 template<typename _StrictWeakOrdering> void merge(list& __x, _StrictWeakOrdering __comp);
93 template<typename _StrictWeakOrdering> void sort(_StrictWeakOrdering);
94 };
merge(list & __x,_StrictWeakOrdering __comp)95 template<typename _Tp, typename _Alloc> template <typename _StrictWeakOrdering> void list<_Tp, _Alloc>:: merge(list& __x, _StrictWeakOrdering __comp) {
96 if (this != &__x) {
97 iterator __first1 = begin();
98 iterator __last1 = end();
99 iterator __first2 = __x.begin();
100 iterator __last2 = __x.end();
101 while (__first1 != __last1 && __first2 != __last2) if (__comp(*__first2, *__first1)) {
102 iterator __next = __first2;
103 __first2 = __next;
104 }
105 }
106 }
sort(_StrictWeakOrdering __comp)107 template<typename _Tp, typename _Alloc> template <typename _StrictWeakOrdering> void list<_Tp, _Alloc>:: sort(_StrictWeakOrdering __comp) {
108 if (this->_M_impl._M_node._M_next != &this->_M_impl._M_node && this->_M_impl._M_node._M_next->_M_next != &this->_M_impl._M_node) {
109 list __carry;
110 list __tmp[64];
111 list * __fill = &__tmp[0];
112 list * __counter;
113 do {
114 for(__counter = &__tmp[0];
115 __counter != __fill && !__counter->empty();
116 ++__counter) { __counter->merge(__carry, __comp); __carry.swap(*__counter); }
117 }
118 while ( !empty() );
119 for (__counter = &__tmp[1];
120 __counter != __fill;
121 ++__counter) __counter->merge(*(__counter - 1), __comp);
122 }
123 }
124 }
125 namespace gloox {
126 class Tag {
127 };
128 class StanzaExtension {
129 };
130 }
131 namespace gloox {
132 }
133 using namespace gloox;
134 class AbstractPurpleRequest {
135 };
136 class AdhocCommandHandler : public AbstractPurpleRequest {
137 };
138 class AdhocTag : public Tag {
139 };
140 class AbstractConfigInterfaceHandler {
141 };
142 namespace gloox {
143 class DataFormField {
144 public:
value()145 const std::string& value() const {
146 }
147 };
148 class DataFormFieldContainer {
149 public:
hasField(const std::string & field)150 bool hasField( const std::string& field ) const {
151 }
152 DataFormField* field( const std::string& field ) const;
153 };
154 class DataForm : public StanzaExtension, public DataFormFieldContainer {
155 };
156 }
157 enum {
158 SORT_BY_JID, SORT_BY_UIN, SORT_BY_BUDDIES, };
159 struct SortData {
160 };
161 struct ListData {
162 std::list<SortData> output;
163 int sort_by;
164 };
165 class AdhocAdmin : public AdhocCommandHandler, public AbstractConfigInterfaceHandler {
166 AdhocTag *handleAdhocTag(Tag *stanzaTag);
167 AdhocTag *handleUnregisterUserForm(Tag *tag, const DataForm &form);
168 AdhocTag *handleListUsersForm(Tag *tag, const DataForm &form);
169 ListData m_listUsersData;
170 };
171 namespace gloox {
172 }
compareIDataASC(SortData & a,SortData & b)173 static bool compareIDataASC(SortData &a, SortData &b) {
174 }
handleListUsersForm(Tag * tag,const DataForm & form)175 AdhocTag *AdhocAdmin::handleListUsersForm(Tag *tag, const DataForm &form) {
176 ListData &data = m_listUsersData;
177 if (data.output.size() == 0) {
178 if (!form.hasField("users_vip") || !form.hasField("show_jid") || !form.hasField("show_uin") || !form.hasField("show_buddies") || !form.hasField("show_sort_by") || !form.hasField("show_sort_order") || !form.hasField("show_max_per_page") ) {
179 }
180 bool sort_asc = form.field("show_sort_order")->value() == "asc";
181 if (data.sort_by == SORT_BY_BUDDIES) {
182 if (sort_asc) data.output.sort(compareIDataASC);
183 }
184 else {
185 }
186 }
187 }
188