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
Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
new3.C
blob
d950259e72a5e8fdb4b67e5b6a0c22dbf75cbc3b
1
// { dg-do run }
2
// { dg-options "-fcheck-new -pedantic -Wno-long-long" }
3
// PRMS Id: 6037
4
5
extern "C" void * malloc (__SIZE_TYPE__);
6
7
int ena = 0;
8
9
struct A {
10
int i;
11
A () { i = 2; }
12
void * operator new (__SIZE_TYPE__ s)
13
{
14
if (ena)
15
return 0;
16
return malloc (s);
17
}
18
};
19
20
struct B {
21
int i;
22
B () { i = 2; }
23
void * operator new (__SIZE_TYPE__ s) throw()
24
{
25
if (ena)
26
return 0;
27
return malloc (s);
28
}
29
};
30
31
int main ()
32
{
33
ena = 1;
34
A *ap = new A;
35
B *bp = new B;
36
37
return ap || bp ;
38
}