Bug 14195 – Ice when mangling templated function parameter extern(C++) function

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-02-17T18:38:00Z
Last change time
2017-07-19T17:38:39Z
Keywords
C++, ice
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2015-02-17T18:38:28Z
struct Delegate1(T) {} struct Delegate2(T1, T2) {} template Signature(T) { alias Signature = typeof(*(T.init)); } alias del1_t = Delegate1!(Signature!(void function())); alias del2_t = Delegate2!(Signature!(int function(float, double)), Signature!(int function(float, double))); extern(C++) { void DelegateTest1(del1_t); void DelegateTest2(del2_t); } When compiling with the latest dmd from git head on windows this will output: Error: ICE: Unsupported type void() Error: ICE: Unsupported type int(float, double) Error: ICE: Unsupported type int(float, double) It should mangle the functions as: static assert(DelegateTest1.mangleof == "?DelegateTest1@@YAXU?$Delegate1@$$A6AXXZ@@@Z"); static assert(DelegateTest2.mangleof == "?DelegateTest2@@YAXU?$Delegate2@$$A6AHMN@Z$$A6AHMN@Z@@@Z");
Comment #1 by code — 2015-02-17T19:24:42Z
Comment #2 by github-bugzilla — 2015-02-20T11:01:34Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c4ef4296e217337de4d4137bae57bfda710454e2 Fixed bug 14195: Added C++ mangling for passing function signatures as template parameters. https://github.com/D-Programming-Language/dmd/commit/a68e1c1d4a08b029490c0c832920e0fdb12d7093 Merge pull request #4419 from Ingrater/fix14195 Fixed bug 14195: Added C++ mangling for passing function signatures
Comment #3 by github-bugzilla — 2015-02-21T09:11:48Z
Commits pushed to https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c4ef4296e217337de4d4137bae57bfda710454e2 Fixed bug 14195: Added C++ mangling for passing function signatures as template parameters. https://github.com/D-Programming-Language/dmd/commit/a68e1c1d4a08b029490c0c832920e0fdb12d7093 Merge pull request #4419 from Ingrater/fix14195
Comment #4 by github-bugzilla — 2015-06-17T21:00:55Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c4ef4296e217337de4d4137bae57bfda710454e2 Fixed bug 14195: Added C++ mangling for passing function signatures as template parameters. https://github.com/D-Programming-Language/dmd/commit/a68e1c1d4a08b029490c0c832920e0fdb12d7093 Merge pull request #4419 from Ingrater/fix14195
Comment #5 by github-bugzilla — 2017-07-19T17:38:39Z
Commits pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/c4ef4296e217337de4d4137bae57bfda710454e2 Fixed bug 14195: Added C++ mangling for passing function signatures as template parameters. https://github.com/dlang/dmd/commit/a68e1c1d4a08b029490c0c832920e0fdb12d7093 Merge pull request #4419 from Ingrater/fix14195