Bug 8392 – DMD sometime fail when using a non static function template within a function template
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2012-07-15T19:18:00Z
Last change time
2014-06-08T02:42:33Z
Assigned to
nobody
Creator
deadalnix
Comments
Comment #0 by deadalnix — 2012-07-15T19:18:40Z
The problem is quite weird, and here the minimal test case I found that produced the error. You'll need at least 2 modules and function template within function template.
module a;
struct A {
}
auto fooa(alias handler)(A a) {
return handler(null);
}
module b;
import a;
class B {
this(B);
}
void foob(A a, B b) {
a.fooa!((arg){
return new B(b);
});
}
Both file in the same folder and issuing dmd *.d will cause the following error :
b.d(9): Error: function b.foob compiler error, parameter 'b', bugzilla 2962?
dmd: glue.c:717: virtual void FuncDeclaration::toObjFile(int): Assertion `0' failed.
Abandon
I obviously checked bug 2962, but it don't seem to be the same one, even if the same assert fails.
Comment #1 by github-bugzilla — 2014-06-08T02:42:29Z