www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14465] New: CTFE exception stacktrace shows location of


          Issue ID: 14465
           Summary: CTFE exception stacktrace shows location of Exception
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

cat > bug.d << CODE
class E : Exception
    this(string msg)

bool foo()
    throw new E("message");

static assert(foo());

dmd -c bug
bug.d(5): Error: uncaught CTFE exception bug.E("message")
bug.d(11):        thrown from here
bug.d(14):        called from here: foo()
bug.d(14):        while evaluating: static assert(foo())

The first line shouldn't be present in the stacktrace, b/c that's code
constructing the exception, which happens before the exception is thrown.

Apr 19 2015