]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/fail_compilation/ice15172.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / ice15172.d
CommitLineData
b4c522fa
IB
1/*
2TEST_OUTPUT:
3---
5fee5ec3 4fail_compilation/ice15172.d(14): Error: constructor `ice15172.ThreadError.this` no match for implicit `super()` call in constructor
b4c522fa
IB
5---
6*/
7
8// 1. ClassDeclaration.semantic
9class 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
21void 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}