This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problems with partial specialization of templates with template parameters




On Wed, 18 Feb 1998, Andrey Slepuhin wrote:

> Hi,
> I have problems with partial specialization of templates
> with template parameters. I.e., trying to compile the following
> example:
> ----------------------------------------------
> template <class T, template <class T> class C>
> struct X
> {};
> 
> template <class T>
> struct Y
> {};
> 
> template <class T>
> struct Z
> {};
> 
> template <class T>
> struct X<T,Y>
> {};
> 
> void main()
> {
>   X<int,Y> a;
>   X<int,Z> b;
> }
> -----------------------------------------------
> I got with egcs-980205:
> -----------------------------------------------
> tmp1.cc:20: sorry, not implemented: use of `template_decl' in template type
> unification
> -----------------------------------------------
> Removing definition of X<T,Y> all works Ok. Also all works, if
> I remove "X<int,Z> b;" line (strange, isn't?). Is something
> really not implemented? Do I use invalid syntax? Or this is
> a bug? Any help is appreciated.
> 
> Regards,
> Andrey.
> 
> 

Thanks for the report.  It's a bug.  It tries to match X<int,Z> against
X<T,Y> and dies with the error message.  I'll post a patch for this.

--Kriang



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]