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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [vect/] [pr44861.cc] - Rev 717

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

// { dg-do compile }
 
bool f();
 
struct counted_base {
    virtual void destroy() { }
    void release() { if (f()) destroy(); }
};
 
struct shared_count {
    shared_count() { }
    ~shared_count() { if (pi) pi->release(); }
    shared_count(shared_count& r) : pi(r.pi) { if (pi) pi->release(); }
    counted_base* pi;
};
 
struct Foo;
 
struct shared_ptr  {
    Foo& operator*() { return *ptr; }
    Foo* ptr;
    shared_count refcount;
};
 
struct Bar {
    Bar(Foo&, shared_ptr);
};
 
void g() {
    shared_ptr foo;
    new Bar(*foo, foo);
}
 
// { dg-final { cleanup-tree-dump "vect" } }
 

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

powered by: WebSVN 2.1.0

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