This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/9649: gcc hangs when static declared twice in templated class
- From: gendzwil at sedsystems dot ca
- To: gcc-gnats at gcc dot gnu dot org
- Date: 10 Feb 2003 20:17:43 -0000
- Subject: c++/9649: gcc hangs when static declared twice in templated class
- Reply-to: gendzwil at sedsystems dot ca
>Number: 9649
>Category: c++
>Synopsis: gcc hangs when static declared twice in templated class
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 10 20:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: gendzwil@sedsystems.ca
>Release: 2.96
>Organization:
>Environment:
Red Hat Linux 7.3 2.96-110
>Description:
If you declare a static data member twice, gcc will hang while compiling. Looks like stuck in a loop to me - top shows gcc sucking 99.9% of cpu.
aaa.h
----------
template <class R, class I> class Aaa
{
public: // methods
Aaa() {}
virtual ~Aaa() {}
static int _test;
static int _test;
};
template < class R, class I > int Aaa<R,I>::_test;
-----------
aab.h
-----------
#include "aaa.h"
class Aab : public Aaa< int, float >
{
public: // methods
Aab();
virtual ~Aab();
};
------------
aab.cpp
------------
#include "aab.h"
Aab::Aab(){}
Aab::~Aab(){}
>How-To-Repeat:
Compile the code included in the description:
gcc aab.cpp
>Fix:
Unknown
>Release-Note:
>Audit-Trail:
>Unformatted: