This is the mail archive of the gcc-bugs@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: Problem with templated class.


> 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

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