ambiguous class template instantiation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



it looks like I had sent this message to the wrong
list (gcc-bugs), I try again here:

--- Adrian Sandor <aditsu@xxxxxxxxx> wrote:
> 
> I think I've just reproduced this problem with gcc
> 3.4
> (experimental mingw 20030928, from thisiscool.com)
> so it looks like it hasn't been fixed; should I
> write
> a bug report? I don't really know how to use that
> bugzilla...
> 
> Adrian
> 
> --- Adrian Sandor <aditsu@xxxxxxxxx> wrote:
> > Hello
> > 
> > I found a problem when trying to compile a piece
> of
> > code. I simplified it to this:
> > 
> > template<class T1, class T2=int>struct s1{};
> > template<class T>struct s2{};
> > template<template<class>class C, class T>struct
> > s2<C<T> >{};
> > template<template<class, class>class C, class T1,
> > class T2>struct s2<C<T1, T2> >{};
> > s2<s1<int> >x1;
> > 
> > here's the compiler output:
> > 
> > g++.exe -c test.cpp -o test.o
> > -I"C:/progs/Dev-Cpp/include/c++"
> > -I"C:/progs/Dev-Cpp/include/c++/mingw32" -pedantic
> > -Wall -W -Wno-long-long -fmessage-length=0
> > test.cpp:5: ambiguous class template instantiation
> > for
> > `struct s2<s1<int, int> >'
> > test.cpp:4: candidates are: struct s2<C<T1, T2> >
> > test.cpp:3: struct s2<C<T> >
> > test.cpp:5: aggregate `s2<s1<int, int> > x1' has
> > incomplete type and cannot be defined
> > test.cpp:5: storage size of `x1' isn't known
> > 
> > the compiler used is gcc 3.2 (mingw)
> > I also confirmed this problem on a gcc 3.2.2
> (linux)
> > 
> > I tested the same code at
> > http://www.dinkumware.com/exam/ using different
> > compilers and there was no error
> > 
> > I'd like to know if this is fixed in later
> versions
> > of
> > gcc (which versions?)
> > I also found some similar reports in the mailing
> > lists, but they're slightly different, so I don't
> > know
> > if it's the same problem
> > 
> > best regards,
> > Adrian


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux