[Issue 11724] New: D emits failed template instantiations
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Dec 11 00:39:23 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11724
Summary: D emits failed template instantiations
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: ibuclaw at ubuntu.com
--- Comment #0 from Iain Buclaw <ibuclaw at ubuntu.com> 2013-12-11 00:39:19 PST ---
It would be nice of the front-end to not emit the following code to object
file, especially so as.
1) Both functions share the same symbol (collision detection doesn't work in
__traits code?)
2) Both functions failed semantic analysis.
---
module failsemantic;
template foo10083a(T)
{
int foo10083a(double) { return 1; }
int foo10083a(T) { return 2; }
}
static assert(!__traits(compiles, foo10083a!double(1)));
static assert(!__traits(compiles, foo10083a!double(1.0)));
---
Disassembly:
---
Disassembly of section
.text._D12failsemantic16__T9foo10083aTdZ9foo10083aFNaNbNfdZi:
0000000000000000 <_D12failsemantic16__T9foo10083aTdZ9foo10083aFNaNbNfdZi>:
0: 55 push %rbp
1: 48 8b ec mov %rsp,%rbp
4: 48 83 ec 10 sub $0x10,%rsp
8: b8 01 00 00 00 mov $0x1,%eax
d: c9 leaveq
e: c3 retq
f: 90 nop
0000000000000010 <_D12failsemantic16__T9foo10083aTdZ9foo10083aFNaNbNfdZi>:
10: 55 push %rbp
11: 48 8b ec mov %rsp,%rbp
14: 48 83 ec 10 sub $0x10,%rsp
18: b8 02 00 00 00 mov $0x2,%eax
1d: c9 leaveq
1e: c3 retq
1f: 90 nop
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list