www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14537] New: Declaring an extern(C++) function in a variadic

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

          Issue ID: 14537
           Summary: Declaring an extern(C++) function in a variadic
                    function template results in an ICE.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: devw0rp gmail.com

I was trying out declaring extern(C++) functions inside of variadic templates,
so that the declarations can be generated automatically, etc. I ran into an
internal compiler error.

void variadic(A...)(A args) {
    extern(C++) void bar(int);

    bar(args); // This causes the error.
}

void main() {
    variadic(3);
}

The following assertion error from the mangler was returned from the above.

dmd: cppmangle.c:185: void CppMangleVisitor::source_name(Dsymbol*, bool):
Assertion `t' failed.

I used DMD 2.067.0.

--
May 02 2015