]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/betterc.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / betterc.d
1 /* REQUIRED_ARGS: -betterC
2 * TEST_OUTPUT:
3 ---
4 fail_compilation/betterc.d(12): Error: Cannot use `throw` statements with -betterC
5 fail_compilation/betterc.d(17): Error: Cannot use try-catch statements with -betterC
6 fail_compilation/betterc.d(29): Error: `TypeInfo` cannot be used with -betterC
7 ---
8 */
9
10 void test()
11 {
12 throw new Exception("msg");
13 }
14
15 void test2()
16 {
17 try
18 {
19 test();
20 }
21 catch (Exception e)
22 {
23 }
24 }
25
26 void test3()
27 {
28 int i;
29 auto ti = typeid(i);
30 }