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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [bad-error6.C] - Diff between revs 305 and 338

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do assemble  }
// { dg-do assemble  }
// GROUPS passed bad-errors
// GROUPS passed bad-errors
typedef __SIZE_TYPE__ size_t;
typedef __SIZE_TYPE__ size_t;
class tt {
class tt {
    public:
    public:
    tt(int);
    tt(int);
    private:
    private:
    void *operator new(size_t a); // Forbid object creation in heap memory.
    void *operator new(size_t a); // Forbid object creation in heap memory.
};
};
void st(const tt&, int);
void st(const tt&, int);
void ff(int i, int j)
void ff(int i, int j)
{
{
    if( i > 0 ) {
    if( i > 0 ) {
        // This work ok.
        // This work ok.
        tt a_tt(i);
        tt a_tt(i);
        st(a_tt, j);
        st(a_tt, j);
    }
    }
    else {
    else {
        // This triggers an error because of private operator new ????.
        // This triggers an error because of private operator new ????.
        st(tt(-i), j);
        st(tt(-i), j);
    }
    }
}
}
 
 

powered by: WebSVN 2.1.0

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