From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Artem Khodush" To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c++/3024: class inheritance of template arguments fail Date: Fri, 01 Jun 2001 03:26:00 -0000 Message-id: <20010601102601.13306.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg00002.html List-Id: The following reply was made to PR c++/3024; it has been noted by GNATS. From: "Artem Khodush" To: Cc: , Subject: Re: c++/3024: class inheritance of template arguments fail Date: Fri, 1 Jun 2001 14:15:30 +0400 > Classes may not inherit from template argument. I use this with > the Microsoft Visual C++ compiler frequently (ATL uses it heavily). > I don't know if this is C++ by the book, or if it is a Microsoft extension. > > The code which fail for me looks like: > > template > class Y : public T > { > // ... > }; > > class X : public Y > { > }; > Your code does not compile with Visual C++ 6.0. The error message is pretty much the same: c:\m\t\main.cpp(4) : error C2504: 'X' : base class undefined This has nothing to do with inheriting from template argument. You want to have a class which indirectly inherits from itself, this is impossible in C++.