mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
Fix Iss24061 - constructor with assert(0) failed to compile (#15489)
This commit is contained in:
parent
c187d643ed
commit
ba5c402161
2 changed files with 16 additions and 1 deletions
|
@ -705,7 +705,7 @@ private extern(C++) final class Semantic3Visitor : Visitor
|
|||
}
|
||||
sc2.ctorflow.freeFieldinit();
|
||||
|
||||
if (cd && !(sc2.ctorflow.callSuper & CSX.any_ctor) && cd.baseClass && cd.baseClass.ctor)
|
||||
if (cd && !(sc2.ctorflow.callSuper & (CSX.any_ctor | CSX.halt)) && cd.baseClass && cd.baseClass.ctor)
|
||||
{
|
||||
sc2.ctorflow.callSuper = CSX.none;
|
||||
|
||||
|
|
15
compiler/test/compilable/test24061.d
Normal file
15
compiler/test/compilable/test24061.d
Normal file
|
@ -0,0 +1,15 @@
|
|||
// https://issues.dlang.org/show_bug.cgi?id=24061
|
||||
|
||||
class Exception2
|
||||
{
|
||||
this(string, int) {}
|
||||
}
|
||||
|
||||
class E : Exception2
|
||||
{
|
||||
this(int i)
|
||||
{
|
||||
scope (success) assert(0, "assume nothrow");
|
||||
super("hehe", 2);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue