Bug 14537 – Declaring an extern(C++) function in a variadic function template results in an ICE.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-02T13:46:04Z
Last change time
2018-05-22T05:30:48Z
Keywords
C++, ice
Assigned to
No Owner
Creator
w0rp

Comments

Comment #0 by devw0rp — 2015-05-02T13:46:04Z
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.
Comment #1 by hsteoh — 2016-09-02T18:09:41Z
Can't reproduce on dmd git HEAD (d4b055cd92a63688a2c3bd9e1cc11ba90a0a9d1a). Maybe this has been fixed since?
Comment #2 by turkeyman — 2018-05-22T05:30:48Z
Still can't repro, 2 years later...