OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr51959.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
 
3
namespace std {
4
    typedef __SIZE_TYPE__ size_t;
5
}
6
inline void* operator new(std::size_t, void* __p) throw() {
7
    return __p;
8
}
9
template  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 class QFlags {
13
    int i;
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 {
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  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);
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
};
54
template  inline void QList::node_construct(Node *n, const T &t) {
55
    if (QTypeInfo::isLarge || QTypeInfo::isStatic) n->v = new T(t);
56
    else if (QTypeInfo::isComplex) new (n) T(t);
57
}
58
template  inline void QList::node_destruct(Node *n) {
59
}
60
template   void QList::append(const T &t) {
61
    if (d->ref != 1) {
62
        try {
63
        }
64
        catch (...) {
65
        }
66
        if (QTypeInfo::isLarge || QTypeInfo::isStatic) {
67
        }
68
        else {
69
            Node *n, copy;
70
            node_construct(©, t);
71
            try {                 n = reinterpret_cast(p.append());;             }
72
            catch (...) {                 node_destruct(©);                 throw;             }
73
            *n = copy;
74
        }
75
    }
76
};
77
void virtual_hook(QSize sz, QList &arg)
78
{
79
  arg.push_back(sz);
80
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.