repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.law
/
bad-error6.C
blob
40e2b99eb74530af2bb6df5a5ba866fd76409849
1
// { dg-do assemble }
2
// GROUPS passed bad-errors
3
typedef __SIZE_TYPE__ size_t;
4
5
class tt {
6
public:
7
tt(int);
8
9
private:
10
void *operator new(size_t a); // Forbid object creation in heap memory.
11
};
12
13
void st(const tt&, int);
14
15
void ff(int i, int j)
16
{
17
if( i > 0 ) {
18
// This work ok.
19
tt a_tt(i);
20
st(a_tt, j);
21
}
22
else {
23
// This triggers an error because of private operator new ????.
24
st(tt(-i), j);
25
}
26
}