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