Bug 20039 – ICE from double template instantiation with getMember of overload of class and template function
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-07-10T12:04:49Z
Last change time
2019-07-10T13:42:55Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature
Comments
Comment #0 by default_357-line — 2019-07-10T12:04:49Z
Consider the following code:
void foo()() { }
class bar { }
alias bug = foo;
alias bug = bar;
template Identity(T...) { }
alias member1 = Identity!(__traits(getMember, mixin(__MODULE__), "bug"));
alias member2 = Identity!(__traits(getMember, mixin(__MODULE__), "bug"));
With this, DMD crashes, because it cannot determine the type of "bug" to see if the template parameters are equal.
Note that with this variation, a different crash ensues:
void main() {
alias member1 = Identity!(.bug);
alias member2 = Identity!(.bug);
}
Comment #1 by simen.kjaras — 2019-07-10T12:19:36Z
I can't get the code to ICE on 2.087.0 on Windows, nor on any DMD version on run.dlang.org (neither the first crash or the second). Is your code example missing some pieces?
Comment #2 by dlang-bot — 2019-07-10T12:34:58Z
@FeepingCreature created dlang/dmd pull request #10159 "Fix issue 20039: when checking for an existing template instance, tolerate expressions without types." fixing this issue:
- Fix issue 20039: when checking for an existing template instance, tolerate expressions without types.
https://github.com/dlang/dmd/pull/10159
Comment #3 by simen.kjaras — 2019-07-10T12:42:56Z
Sorry, I'm wrong - it does segfault on run.dlang.io, but not on 2.087.0 on Windows.
Comment #4 by dlang-bot — 2019-07-10T13:42:55Z
dlang/dmd pull request #10159 "Fix issue 20039: when checking for an existing template instance, tolerate expressions without types." was merged into stable:
- fca2b0256acc12c8c273c264c10798b5e7b81bb1 by Mathis Beer:
Fix issue 20039: when checking for an existing template instance, tolerate expressions without types.
https://github.com/dlang/dmd/pull/10159