[Issue 22148] New: noreturn ICE on templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 27 09:55:47 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22148

          Issue ID: 22148
           Summary: noreturn ICE on templates
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: temtaime at gmail.com

import std;

bool throwError(string S, string File = __FILE__, uint Line = __LINE__, A...)(A
args)
{
        return throwError(args.format!S, File, Line);
}

noreturn throwError(T)(T value, string file = __FILE__, uint line = __LINE__)
{
        throw new Exception(value.to!string, file, line);
}

void main()
{
    try { throwError!`%s`(10); } catch(Exception) {}
}

Result:

Illegal instruction (core dumped)

Expected:

pass OK

--


More information about the Digitalmars-d-bugs mailing list