diff --git a/compiler/src/dmd/statementsem.d b/compiler/src/dmd/statementsem.d index 5b8883f6941e..0fa81205369f 100644 --- a/compiler/src/dmd/statementsem.d +++ b/compiler/src/dmd/statementsem.d @@ -323,7 +323,7 @@ package (dmd) extern (C++) final class StatementSemanticVisitor : Visitor * As: * s; * try { s1; s2; } - * catch (Throwable __o) + * catch (Exception __o) * { sexception; throw __o; } */ auto a = new Statements(); @@ -344,7 +344,7 @@ package (dmd) extern (C++) final class StatementSemanticVisitor : Visitor } auto catches = new Catches(); - auto ctch = new Catch(Loc.initial, getThrowable(), id, handler); + auto ctch = new Catch(Loc.initial, getException(), id, handler); ctch.internalCatch = true; catches.push(ctch); diff --git a/compiler/test/compilable/test17493.d b/compiler/test/compilable/test17493.d new file mode 100644 index 000000000000..d9fcbd8d1474 --- /dev/null +++ b/compiler/test/compilable/test17493.d @@ -0,0 +1,11 @@ +// https://issues.dlang.org/show_bug.cgi?id=17493 + +struct S { + ~this() {} +} + +class C { + S s; + + this() nothrow {} +}