* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / nullptr21.C
blobc6f560e296b6943a14975ade5a1dabcdf63d263c
1 // { dg-do run { target c++11 } }
3 // Test throw and catch
5 extern "C" void abort (void);
7 typedef decltype(nullptr) nullptr_t;
9 int result[2];
11 void __attribute__((noinline))
12 foo (int i, int j)
14   result[i] = j;
17 int main()
19   try {
20     throw nullptr;
21   } catch (bool) {
22     foo (0, 2);
23   } catch (int) {
24     foo (0, 3);
25   } catch (long int) {
26     foo (0, 4);
27   } catch (nullptr_t) {
28     foo (0, 5);
29   } catch (...) {
30     foo (0, 6);
31   }
33   nullptr_t mynull = 0;
34   try {
35     throw mynull;
36   } catch (bool) {
37     foo (1, 2);
38   } catch (int) {
39     foo (1, 3);
40   } catch (long int) {
41     foo (1, 4);
42   } catch (nullptr_t) {
43     foo (1, 5);
44   } catch (...) {
45     foo (1, 6);
46   }
48   if (result[0] != 5 || result[1] != 5)
49     abort ();