Summary: Segfault with pure auto function in separate module
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Stanislav Blinov <> 2010-12-24 
02:01:50 PST ---
When a module has a non-templated function that is pure and has auto result
type, and at least one parameter, compiler segfaults when compiling another
module that imports the first and invokes the function.

Test case:
module mod;

// parameter type doesn't matter,
// as long as there is at least one parameter
// and function is not templated
pure auto foo(bool b)
    return 1;

module main;
import mod;

void main()
$ dmd -v test.d mod.d

binary    dmd
version   v2.051
config    /home/user/dmd.conf
parse     test
parse     mod
importall test
import    object    (/home/user/dmd2/src/druntime/import/object.di)
importall mod
semantic  test
semantic  mod
semantic2 test
semantic2 mod
semantic3 test
Segmentation fault

Removing pure or parameters or replacing auto with concrete type, or making
function templated, resolves segfault. If the function is defined and used in
the same module that is being compiled, segfault doesn't occur either.

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

Reply via email to