Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/ice15172.d

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice15172.d(14): Error: constructor `ice15172.ThreadError.this` no match for implicit `super()` call in constructor
5 ---
6 */
7
8 // 1. ClassDeclaration.semantic
9 class ThreadError : Error
10 {
11 // 2. FuncDeclaration.semantic
12 // 4. FuncDeclaration.semantic3
13 // --> error happens
14 this(string)
15 {
16 }
17 }
18
19 // 3. FuncDeclaration.semantic
20 // 5. FuncDeclaration.semantic3
21 void onThreadError()
22 {
23 // 6. NewExp.semantic
24 // --> cd.members.errors == false, cd.members.semantic3Errors == true
25 // BUT, The ThreadError class constructor is not a template function, so
26 // the errors inside its function body won't be associated with the validness of this NewExp.
27 // Therefore, converting the semantic3Error to ErrorExp is not correct.
28 // 7. ctfeInterpret
29 // Finally, FuncDeclaration::interpret may encounter a function which is semantic3Errors == true. So
30 // 7a. functionSemantic3() should return false if semantic3Errors is true.
31 // 7b. the function body errors may not happen during ctfeInterpret call and global.errors could be unincremented.
32 __gshared auto ThreadError = new ThreadError(null);
33 }