Bug 10969 – Variadic template parameter re-use in function signature

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-05T02:31:00Z
Last change time
2013-10-01T04:19:06Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
john.loughran.colvin

Comments

Comment #0 by john.loughran.colvin — 2013-09-05T02:31:58Z
template A(T, U...) { alias A = T; } void foo(T, U...)(A!(T, U) a){} foo!(int, float)(3); /d53/f246.d(9): Error: template D main.foo does not match any function template declaration. Candidates are: /d53/f246.d(7): f246.main.foo(T, U...)(A!(T, U) a) /d53/f246.d(9): Error: template f246.main.foo(T, U...)(A!(T, U) a) cannot deduce template function from argument types !(int, float)(int) /d53/f246.d(9): Error: template instance foo!(int, float) errors instantiating template This also fails: template A(T, U) { alias A = T; } void foo(T, U...)(A!(T, U[0]) a){} foo!(int, float)(3); /d746/f639.d(9): Error: template D main.foo does not match any function template declaration. Candidates are: /d746/f639.d(7): f639.main.foo(T, U...)(A!(T, U[0]) a) /d746/f639.d(9): Error: template f639.main.foo(T, U...)(A!(T, U[0]) a) cannot deduce template function from argument types !(int, float)(int) /d746/f639.d(9): Error: template instance foo!(int, float) errors instantiating template
Comment #1 by k.hara.pg — 2013-09-05T02:58:28Z
Comment #2 by github-bugzilla — 2013-10-01T04:18:55Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/da93bfdf9021b832ff40512e6910600e753755a3 fix Issue 10969 - Variadic template parameter re-use in function signature https://github.com/D-Programming-Language/dmd/commit/57ea22827f40b128fcc9aad16882a3ab2184d7fd Merge pull request #2526 from 9rnsr/fix10969 Issue 10969 - Variadic template parameter re-use in function signature