Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/bad_array_new1.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 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 } |