[cfe-dev] FW: Clang 3.0 variadic template pack expansion error
Eli Friedman
eli.friedman at gmail.com
Mon Jan 9 18:00:49 PST 2012
On Mon, Jan 9, 2012 at 5:10 PM, Nathan Ridge <zeratul976 at hotmail.com> wrote:
>> From: zeratul976 at hotmail.com
>> To: nickrmc83 at gmail.com
>> Subject: RE: [cfe-dev] Clang 3.0 variadic template pack expansion error
>> Date: Tue, 10 Jan 2012 01:10:16 +0000
>>
>>
>> Hi Nick,
>>
>> > I have been looking at some basic variadic template uses and so decided
>> > to give clang a go.
>> >
>> > I downloaded the latest binaries from
>> > http://llvm.org/releases/download.html for Ubuntu 11.10 and have tried
>> > compiling the below code without success. The error returned is Error:
>> > too many template parameters in template redeclaration. I believe the
>> > syntax is correct. Can somebody confirm whether the error is a compiler
>> > bug or simply incorrect implementation.
>>
>> It is incorrect implementation :)
>>
>> There are two mistakes in your code:
>>
>> 1)
>>
>> template // Too many template parameters
>> class Tuple : public Tuple
>>
>> should be
>>
>> template // Too many template parameters
>>
>> class Tuple : public Tuple
>>
>> since you want to declare a (partial) specialization of the primary template,
>> not the primary template itself.
Your formatting got corrupted here; I assume you mean "class
Tuple<FirstType, RestTypes...> : public Tuple<RestTypes...>"
-Eli
More information about the cfe-dev
mailing list