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
Rebase.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
init
/
new11.C
blob
a13f262aa64ab75674837fadf96ed6932e3cbed1
1
// PR c++/17670
2
// { dg-do run }
3
4
#include <cstdlib>
5
#include <new>
6
7
bool abort_new;
8
void *operator new[](size_t bytes)
9
#if __cplusplus <= 199711L
10
throw (std::bad_alloc)
11
#endif
12
{
13
if (abort_new)
14
abort();
15
return operator new (bytes);
16
}
17
18
19
struct X {};
20
int main () {
21
// Do not abort until main is running in case startup code uses
22
// operator new[].
23
abort_new = true;
24
new (X);
25
}