www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24519] New: compiler segfault on single default constructor

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

          Issue ID: 24519
           Summary: compiler segfault on single default constructor
                    argument
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: lr decard.io

I Found that when i use the buildPath() as the only default argument in a class
constructor it causes a segment fault in the compiler.

---
import std.path;

class A {
    this(string path = buildPath("a", "b")) {
    }
}

void main() {
    auto a = new A();
}
---

$ dmd --version
 DMD64 D Compiler v2.108.0
$ dmd comp_seq.d
 fish: Job 1, 'dmd comp_seg.d' terminated by signal SIGSEGV (Address boundary
error)
$ dmd --version
 DMD64 D Compiler v2.105.2
$ dmd comp_seq.d

--
Apr 23