c++/9649: gcc hangs when static declared twice in templated class

gendzwil@sedsystems.ca gendzwil@sedsystems.ca
Mon Feb 10 20:26:00 GMT 2003


>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:



More information about the Gcc-bugs mailing list