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
Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git]
/
main
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
bad_array_new1.C
blob
2052d3991e83eb4b4c767e911306c4577ccaef71
1
// Test for throwing bad_array_new_length on invalid array length
2
// { dg-do run { target c++11 } }
3
4
#include <new>
5
6
void * f(int i)
7
{
8
return new int[i];
9
}
10
11
int main()
12
{
13
try
14
{
15
f(-1);
16
}
17
catch (std::bad_array_new_length) { return 0; }
18
__builtin_abort ();
19
}