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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr35164-2.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
struct __shared_count {
2
    __shared_count() { _M_pi = new int; }
3
    int * _M_pi;
4
};
5
template
6
class __shared_ptr {
7
public:
8
    __shared_ptr(_Tp* __p);
9
    void reset(int * __p) {
10
        __shared_ptr(__p).swap(*this);
11
    }
12
    void swap(__shared_ptr<_Tp>& __other) {
13
        __other._M_refcount._M_pi = _M_refcount._M_pi;
14
    }
15
    __shared_count _M_refcount;
16
};
17
template class shared_ptr : public __shared_ptr<_Tp> {};
18
int main() {
19
    for (shared_ptr *iter;;)
20
    {
21
        try {
22
            (iter++)->reset(new int);
23
        }
24
        catch (...) {
25
        }
26
    }
27
}

powered by: WebSVN 2.1.0

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