mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

This makes the following changes: - Add template `_d_newclassT` to `druntime.src.core.lifetime.d` - Replace lowering of `new C()` to `_d_newclassT!C()` - Add `lowering` member to `NewExp`. This field stores the above lowering to be used by e2ir.d - Keep the old `_d_newclass` hook because it's used by `TypeInfo_Class.create()` - Add dummy `_d_newclassT` hook to tests that redefine the `object` module - Remove `new MinHeap!(TestType)()` from `fail308.d`. Otherwise the errror was changed and printed the local path to druntime - Move `err` to global scope in rt.sections.d to avoid the frontend lowering - Account for the `GC.malloc()` called by the template hook in the `-profile=gc` tests Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com> Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
35 lines
466 B
D
35 lines
466 B
D
// https://issues.dlang.org/show_bug.cgi?id=23431
|
|
// REQUIRED_ARGS: -lowmem
|
|
module object;
|
|
|
|
alias string = immutable(char)[];
|
|
class Throwable { }
|
|
class Exception : Throwable
|
|
{
|
|
this(string )
|
|
{
|
|
}
|
|
}
|
|
|
|
class Error { }
|
|
|
|
// Needed to lower `new Exception("ice")` to it.
|
|
T _d_newclassT(T)()
|
|
if (is(T == class))
|
|
{
|
|
return null;
|
|
}
|
|
|
|
void test23431()
|
|
{
|
|
int a;
|
|
|
|
try
|
|
{
|
|
throw new Exception("test1");
|
|
a++;
|
|
}
|
|
finally
|
|
{
|
|
}
|
|
}
|