Bug 14500 – AliasDeclaration::semantic corrupts Type
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-25T15:36:00Z
Last change time
2015-04-25T16:18:43Z
Assigned to
nobody
Creator
jbc.engelen
Comments
Comment #0 by jbc.engelen — 2015-04-25T15:36:31Z
The following code
alias ImGuiCol = int;
alias Func = const char* function(ImGuiCol);
results in a call to AliasDeclaration::semantic for Func, where the declaration is resolved and stored into AliasDeclaration::type as "const( char* function(int) )". However, type is now partly "corrupt"/unresolved:
->toChar() = "const( char* function(int) )", but
->mutableOf()->toChar() = "const( char* function(ImGuiCol) )"
LDC will crash because of this. See LDC Github issue #893 [1].
[1] https://github.com/ldc-developers/ldc/issues/893
Comment #1 by jbc.engelen — 2015-04-25T16:18:43Z
This is already fixed in HEAD.
In declaration.c, around line 382
- type = type->addStorageClass(storage_class);
+ type = type->addSTC(storage_class);