This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: problems with partial specialization of templates with template parameters
- To: Andrey Slepuhin <pooh at msu dot ru>
- Subject: Re: problems with partial specialization of templates with template parameters
- From: Kriang Lerdsuwanakij <lerdsuwa at scf-fs dot usc dot edu>
- Date: Wed, 18 Feb 1998 14:53:11 -0800 (PST)
- cc: egcs at cygnus dot com, Kriang Lerdsuwanakij <lerdsuwa at scf-fs dot usc dot edu>, Mark Mitchell <mmitchell at usa dot net>
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