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
* auto-profile.c (afdo_annotate_cfg): Use update_max_bb_count.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
new6.C
blob
7013337b21be599dd9dad13d0db8a8152efd67a3
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)
12
#if __cplusplus <= 199711L
13
throw (std::bad_alloc)
14
#endif
15
{
16
if (special)
17
return &space;
18
return malloc (size);
19
}
20
21
int main ()
22
{
23
special = 1;
24
int *p = new int();
25
special = 0;
26
return *p != 0;
27
}