1 // { dg-do compile }
2
3 namespace std {
4 typedef __SIZE_TYPE__ size_t;
5 }
new(std::size_t,void * __p)6 inline void* operator new(std::size_t, void* __p) throw() {
7 return __p;
8 }
9 template <typename T> class QTypeInfo {
10 };
11 enum { Q_COMPLEX_TYPE = 0, Q_PRIMITIVE_TYPE = 0x1, Q_STATIC_TYPE = 0, Q_MOVABLE_TYPE = 0x2, Q_DUMMY_TYPE = 0x4 };
12 template<typename Enum> class QFlags {
13 int i;
QFlags(Enum f)14 inline QFlags(Enum f) : i(f) { }
15 };
16 class __attribute__((visibility("default"))) QSize {
17 public:
18 bool isEmpty() const;
19 friend inline bool operator==(const QSize &, const QSize &);
20 int wd;
21 int ht;
22 };
23 template<> class QTypeInfo<QSize > {
24 public:
25 enum {
26 isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isLarge = (sizeof(QSize)>sizeof(void*)), isPointer = false, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0) };
27 };
28 class __attribute__((visibility("default"))) QBasicAtomicInt {
29 public:
30 inline bool operator!=(int value) const { }
31 };
32 struct __attribute__((visibility("default"))) QListData {
33 struct Data {
34 QBasicAtomicInt ref;
35 };
36 void **append();
37 };
38 template <typename T> class QList {
39 struct Node {
40 void *v;
41 };
42 union {
43 QListData p;
44 QListData::Data *d;
45 };
46 public:
47 void append(const T &t);
push_back(const T & t)48 inline void push_back(const T &t) {
49 append(t);
50 }
51 void node_construct(Node *n, const T &t);
52 void node_destruct(Node *n);
53 };
node_construct(Node * n,const T & t)54 template <typename T> inline void QList<T>::node_construct(Node *n, const T &t) {
55 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) n->v = new T(t);
56 else if (QTypeInfo<T>::isComplex) new (n) T(t);
57 }
node_destruct(Node * n)58 template <typename T> inline void QList<T>::node_destruct(Node *n) {
59 }
append(const T & t)60 template <typename T> void QList<T>::append(const T &t) {
61 if (d->ref != 1) {
62 try {
63 }
64 catch (...) {
65 }
66 if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic) {
67 }
68 else {
69 Node *n, copy;
70 node_construct(©, t);
71 try { n = reinterpret_cast<Node *>(p.append());; }
72 catch (...) { node_destruct(©); throw; }
73 *n = copy;
74 }
75 }
76 };
virtual_hook(QSize sz,QList<QSize> & arg)77 void virtual_hook(QSize sz, QList<QSize> &arg)
78 {
79 arg.push_back(sz);
80 }
81