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

Subversion Repositories openrisc

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

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
class Noncopyable  { };
10
struct CollectorCell { };
11
template class PassRefPtr {
12
public:
13
    T* releaseRef() const { }
14
};
15
template  class NonNullPassRefPtr {
16
public:
17
    template  NonNullPassRefPtr(const PassRefPtr& o)
18
        : m_ptr(o.releaseRef()) { }
19
    mutable T* m_ptr;
20
};
21
struct ClassInfo;
22
class JSValue { };
23
JSValue jsNull();
24
class Structure;
25
class JSGlobalData {
26
    static void storeVPtrs();
27
};
28
class JSCell : public Noncopyable {
29
    friend class JSObject;
30
    friend class JSGlobalData;
31
    virtual ~JSCell();
32
};
33
class JSObject : public JSCell {
34
public:
35
    explicit JSObject(NonNullPassRefPtr);
36
    static PassRefPtr createStructure(JSValue prototype) { }
37
};
38
class JSByteArray : public JSObject {
39
    friend class JSGlobalData;
40
    enum VPtrStealingHackType { VPtrStealingHack };
41
    JSByteArray(VPtrStealingHackType)
42
        : JSObject(createStructure(jsNull())), m_classInfo(0) { }
43
    const ClassInfo* m_classInfo;
44
};
45
void JSGlobalData::storeVPtrs() {
46
    CollectorCell cell;
47
    void* storage = &cell;
48
    JSCell* jsByteArray = new (storage) JSByteArray(JSByteArray::VPtrStealingHack);
49
    jsByteArray->~JSCell();
50
}

powered by: WebSVN 2.1.0

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