D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4311 - Applying a template to a variadic template parameter in a templated function's parameter list breaks compilation
Summary: Applying a template to a variadic template parameter in a templated function'...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-14 06:39 UTC by Simen Kjaeraas
Modified: 2012-05-13 12:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Simen Kjaeraas 2010-06-14 06:39:51 UTC
Test case:

template foo( T... ) {
    alias T[0] foo; // Does not matter what is in here
}

auto bar( T... )( foo!T arg ) {
}

bar!( int, float )( 2 );



Error: template bar(T...) does not match any function template declaration
Error: template bar(T...) cannot deduce template function from argument types !(1,2)()
Error: template instance errors instantiating template
Comment 1 Simen Kjaeraas 2010-06-14 06:42:13 UTC
Also, this works:

alias bar!( int, float ) baz;
baz( 2, 3 );
Comment 2 Simen Kjaeraas 2010-10-26 15:26:36 UTC
(In reply to comment #1)
> Also, this works:
> 
> alias bar!( int, float ) baz;
> baz( 2, 3 );

Apparently, this either no longer works, or I was a bit drunk when I wrote it. remove the 3, and things work:

alias bar!( int, float ) baz;
baz( 2 );
Comment 3 Brad Roberts 2011-02-06 15:39:49 UTC
Mass migration of bugs marked as x86-64 to just x86.  The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.
Comment 4 SomeDude 2012-04-21 15:03:40 UTC
Compiles on 2.059.
Comment 5 Simen Kjaeraas 2012-05-13 12:27:11 UTC
Indeed.