This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
template template specialisation bug
- From: "Richard Crossley [Digitimer]" <rdc at rdcdesign dot com>
- To: <bug-gcc at gnu dot org>
- Date: Mon, 9 Dec 2002 14:31:45 -0000
- Subject: template template specialisation bug
<version>
Reading specs from ./../lib/gcc-lib/mingw32/3.2/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as
--host=mingw32 --target=mingw32 --prefix=/mingw
--enable-threads --disable-nls --enable-languages=f77,c++,objc,ada
--disable-win32-registry --disable-shared
Thread model: win32
gcc version 3.2 (mingw special 20020817-1)
</version>
<code>
template <typename T>
struct F1;
template <template <typename> class F,typename A0>
struct F1<F<A0> >{}; // [line 72]
template <template <typename,typename> class F,typename A0,typename A1>
struct F1<F<A0,A1> >{}; // [line 74]
template <typename A0,typename A1>
struct t1{};
template <typename A0 = int,typename A1 = int> // note default
parameters
struct t2{};
int main()
{
F1<t1<int,int> > X1;
F1<t2<int,int> > X2; // fails here [line 84]
return 0;
}
</code>
<diagnostic>
main.cpp: In function `int main()':
main.cpp:84: ambiguous class template instantiation for `struct
F1<t2<int, int> >'
main.cpp:74: candidates are: struct F1<F<A0, A1> >
main.cpp:72: struct F1<F<A0> >
main.cpp:84: aggregate `F1<t2<int, int> > X2' has incomplete type and
cannot be defined
</diagnostic>
Regards,
Richard Crossley
mailto:rdc@rdcdesign.com