Summary: Compiler should 'soldier on' after template errors
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD

--- Comment #0 from Don <> 2012-02-10 22:03:55 PST ---
At the start of TemplateInstance::semantic is this code:
    if (global.errors)
        //printf("not instantiating %s due to %d errors\n", toChars(),
        if (!global.gag)
            /* Trying to soldier on rarely generates useful messages
             * at this point.
It's a hack, really. This has the effect that after ANY error, any template
instantiation will abort compilation completely. Back in the Bad Old Days, when
the compiler soldiered on, it would spew reams of garbage and then crash. But
now, with all of the ErrorExp improvements, soldiering on does in fact generate
useful error messages.
If there have been errors in the template arguments, obviously it shouldn't
instantiate it, but there's no need to abort compilation completely. More
importantly, notice that it *does* continue if errors are gagged.  Aborting
compilation is hampering our ability to observe what it's doing.
Soldiering on will help make it more robust.

Simple example: this code should generate two errors, one for 'zoo' and one for

int foo(X)(X x) { return 6; }

void main()

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to