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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-fno-exceptions" }
3
 
4
typedef unsigned int uint;
5
struct QShared {
6
    bool deref() {
7
        return !--count;
8
    }
9
    uint count;
10
};
11
template  class QValueListNode {
12
public:
13
    QValueListNode* next;
14
    QValueListNode* prev;
15
};
16
template  class QValueListPrivate : public QShared {
17
public:
18
    typedef QValueListNode Node;
19
    typedef QValueListNode* NodePtr;
20
    QValueListPrivate();
21
    void derefAndDelete()     {
22
        if ( deref() )      delete this;
23
    }
24
    ~QValueListPrivate();
25
    NodePtr node;
26
};
27
template   QValueListPrivate::QValueListPrivate() {
28
    node = new Node;
29
    node->next = node->prev = node;
30
}
31
template   QValueListPrivate::~QValueListPrivate() {
32
    NodePtr p = node->next;
33
    while( p != node ) {
34
        NodePtr x = p->next;
35
        delete p;
36
        p = x;
37
    }
38
}
39
template  class QValueList {
40
public:
41
    QValueList() {
42
        sh = new QValueListPrivate;
43
    }
44
    ~QValueList() {
45
        sh->derefAndDelete();
46
    }
47
    QValueListPrivate* sh;
48
};
49
class Cell {
50
    QValueList obscuringCells() const;
51
};
52
QValueList Cell::obscuringCells() const {
53
    QValueList empty;
54
}

powered by: WebSVN 2.1.0

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