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
Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
new6.C
blob
3afb2b7e489f294b68d02a0cae0e45cfb52db273
1
// { dg-do run }
2
// Test that we properly default-initialize the new int when () is given.
3
4
#include <new>
5
using namespace std;
6
extern "C" void *malloc (size_t);
7
8
int special;
9
int space = 0xdeadbeef;
10
11
void *operator new (size_t size) throw (bad_alloc)
12
{
13
if (special)
14
return &space;
15
return malloc (size);
16
}
17
18
int main ()
19
{
20
special = 1;
21
int *p = new int();
22
special = 0;
23
return *p != 0;
24
}