Bug 7252 – ICE(template.c): 'global.errors' on line 4893 in file 'template.c'
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2012-01-09T06:38:00Z
Last change time
2013-01-03T00:31:05Z
Keywords
ice, pull
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2012-01-09T06:38:05Z
import std.conv;
//~ alias const(char)* function() CFunc; // fixed version
alias const char* function() CFunc;
void main()
{
CFunc cFunc;
auto name = to!string(cFunc());
}
The fixed version compiles, the one below it produces an ICE:
Assertion failure: 'global.errors' on line 4893 in file 'template.c'
abnormal program termination
Comment #1 by k.hara.pg — 2012-12-24T17:54:52Z
Reduced test case:
----
alias char* function() Func;
// The error disappears by masking this.
alias const char* function() CFunc;
void to(S)(S) { }
void main()
{
CFunc cFunc;
to(cFunc());
}
----
It seems a kind of incorrect type merging issue.