This is the mail archive of the gcc-prs@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]
Other format: [Raw text]

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


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


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