Bug 2711 – -H produces bad headers files if function defintion is templated and have auto return value
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-03-06T11:44:00Z
Last change time
2015-06-09T05:14:45Z
Assigned to
bugzilla
Creator
witold.baryluk+d
Comments
Comment #0 by witold.baryluk+d — 2009-03-06T11:44:46Z
# cat header.d
auto c(T)(T x) {
return x;
}
# dmd -c -H header.d
# cat header.di
// D import file generated from 'header.d'
template c(T)
{
c(T x)
{
return x;
}
}
Currenly std/math.d function abs in phobos have problem.
Comment #1 by witold.baryluk+d — 2009-03-06T11:46:49Z
Simpler example (without templates):
# cat header2.d
auto c(int x) {
return 5;
}
# dmd -c -H header2.d
# cat header2.di
// D import file generated from 'header2.d'
c(int x)
{
return 5;
}
Comment #2 by bugzilla — 2009-04-01T13:48:11Z
Fixed DMD 1.042 and 2.027
Comment #3 by villytiger — 2014-07-27T17:34:34Z
I got the same problem (only with template) on version 2.065.
# cat header.d
auto c(T)(T x) {
return x;
}
# dmd -c -H header.d
# cat header.di
// D import file generated from 'header.d'
c(T)(T x)
{
return x;
}
Comment #4 by k.hara.pg — 2014-07-28T08:54:27Z
(In reply to Ilya Lyubimov from comment #3)
> I got the same problem (only with template) on version 2.065.
>
> # cat header.d
> auto c(T)(T x) {
> return x;
> }
> # dmd -c -H header.d
> # cat header.di
> // D import file generated from 'header.d'
> c(T)(T x)
> {
> return x;
> }
The regression in 2.065 has been fixed in issue 12266.