This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with templated class.
- To: zvyagin at gamspc7 dot ihep dot su
- Subject: Re: Problem with templated class.
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Wed, 12 Apr 2000 23:07:45 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <Pine.LNX.4.20.0004121154330.22371-100000@gamspc7.ihep.su>
> template <class T> class A {};
> class A<int>; // this line prevents successful compilation
> class B: A<int> {};
Thanks for your bug report. This is ill-formed code - why do you think
it should compile? The 'class A<int>;' construct looks like an
elaborated-type-specifier. However, template-ids are not allowed there
(7.1.5.3, [dcl.type.elab]).
If you question this analysis, please discuss it in one of the public
C++ fora first, eg. comp.lang.c++.moderated, or comp.std.c++.
Regards,
Martin