2711 – -H produces bad headers files if function defintion is templated and have auto return value

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2711 - -H produces bad headers files if function defintion is templated and have auto return value
Summary: -H produces bad headers files if function defintion is templated and have aut...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2009年03月06日 11:44 UTC by Witold Baryluk
Modified: 2015年06月09日 05:14 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Witold Baryluk 2009年03月06日 11:44:46 UTC
# 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 Witold Baryluk 2009年03月06日 11:46:49 UTC
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 Walter Bright 2009年04月01日 13:48:11 UTC
Fixed DMD 1.042 and 2.027
Comment 3 Ilya Lyubimov 2014年07月27日 17:34:34 UTC
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 Kenji Hara 2014年07月28日 08:54:27 UTC
(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.


AltStyle によって変換されたページ (->オリジナル) /