www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21930] New: ICE (illegal instruction) with bad code


          Issue ID: 21930
           Summary: ICE (illegal instruction) with bad code
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code.viator gmail.com

dustmitted code

import std : enforce, getSymbolsByUDA, readText;
Token string;
alias C(X) = getSymbolsByUDA!(__traits(parent, X), X);
enum A;
struct U { static foreach (T; C!A) {} }
class R { this(string) { } }
 system main() { new R; }

output on dmd 2.096.1
app.d(2): Error: undefined identifier `Token`
app.d(7): Error: function `D main` must return `int` or `void`
fish: “dmd app.d” terminated by signal SIGILL (Illegal instruction)

May 18 2021