This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29839] New: Template static member inherited from template class cannot be initialized
- From: "mkielar at go2 dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Nov 2006 01:17:10 -0000
- Subject: [Bug c++/29839] New: Template static member inherited from template class cannot be initialized
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
A - template static member class
B - template class containing A
C - class inheriting from specialized class B
Class C is to inherit a static member appropriate for its class.
The last line is intended as definition of this static member.
template<class T> class A
{
public:
A() {}
virtual ~A() {}
};
template<class T> class B {
private:
static A<T> B_Aobj;
};
class C :
private B<C>
{};
A<C> B<C>::B_Aobj();
Tested on:
*** Linux
*** gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)
returns:
bug.cpp:16: error: too few template-parameter-lists
*** Windows - MinGW
*** gcc version 3.4.2 (mingw-special)
returns:
bug.cpp:16: error: too few template-parameter-lists
--
Summary: Template static member inherited from template class
cannot be initialized
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mkielar at go2 dot pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29839