summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/bad-error6.C
blob: 40e2b99eb74530af2bb6df5a5ba866fd76409849 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// { dg-do assemble  }
// GROUPS passed bad-errors
typedef __SIZE_TYPE__ size_t;

class tt {
    public:
    tt(int);

    private:
    void *operator new(size_t a); // Forbid object creation in heap memory.
};

void st(const tt&, int);

void ff(int i, int j)
{
    if( i > 0 ) {
        // This work ok.
        tt a_tt(i);
        st(a_tt, j);
    }
    else {
        // This triggers an error because of private operator new ????.
        st(tt(-i), j);
    }
}