This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38683] New: Variadic templates not allowed into a templated declaration
- From: "ereslibre at ereslibre dot es" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Dec 2008 15:28:56 -0000
- Subject: [Bug c++/38683] New: Variadic templates not allowed into a templated declaration
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code throws this to me on a gcc 4.3.2 version:
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --enable-threads=posix
--mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit
--disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu
--disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.3.2 (GCC)
The thrown error message by the compiler is:
$ gcc --std=c++0x -o test main.cpp
main.cpp: In function ‘void create()’:
main.cpp:16: error: expected `;' before ‘it’
If I uncomment the commented line out, and comment the failing one, it compiles
correctly as expected.
===============================================
#include <list>
class DummyClass
{
};
template <class... Foo>
class MyClass
: public DummyClass
{
};
template <class... Foo>
static void create()
{
std::list<MyClass<Foo...>*>::iterator it;
// std::list<DummyClass*>::iterator it;
}
int main(int argc, char **argv)
{
return 0;
}
===============================================
--
Summary: Variadic templates not allowed into a templated
declaration
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ereslibre at ereslibre dot es
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38683