🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1118

Doubly defined class brings compiler into infinite loop.

#1118
From: Carsten Koch
Date: Tue, 10 Nov 1992 10:35
42 lines
2604 bytes
A doubly defined class that has both an explicit constructor and destructor
puts the compiler into an infinite loop. In the following example, I killed
cc1plus after 138 seconds:

------------------------------------------------------------------------
% cat bug.C
class loop
{
   loop();
   ~loop();
};
class loop
{
   loop();
   ~loop();
};
% time gcc -v bug.C
Reading specs from /usr/local/lib/gcc-lib/mips-sgi-irix4/2.3.1/specs
gcc version 2.3.1
 /usr/local/lib/gcc-lib/mips-sgi-irix4/2.3.1/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dunix -Dmips -Dsgi -DSVR3 -Dhost_mips -DMIPSEB -DSYSTYPE_SYSV -D__unix__ -D__mips__ -D__sgi__ -D__SVR3__ -D__host_mips__ -D__MIPSEB__ -D__SYSTYPE_SYSV__ -D__unix -D__mips -D__sgi -D__SVR3 -D__host_mips -D__MIPSEB -D__SYSTYPE_SYSV -D__CHAR_UNSIGNED__ -D__EXTENSIONS__ -D_MIPSEB -D_SYSTYPE_SYSV -D_LANGUAGE_C_PLUS_PLUS bug.C /usr/tmp/cca00632.i
GNU CPP version 2.3.1 [AL 1.1, MM 28] Silicon Graphics Mips
 /usr/local/lib/gcc-lib/mips-sgi-irix4/2.3.1/cc1plus /usr/tmp/cca00632.i -quiet -dumpbase bug.cc -version -o /usr/tmp/cca00632.s
GNU C++ version 2.3.1 [AL 1.1, MM 28] Silicon Graphics Mips compiled by GNU C version 2.3.1.
bug.C:5: warning: all member functions in class `loop' are private
bug.C:0: warning: class `loop' only defines a private destructor and has no friends
bug.C:5: warning: class `loop' only defines private constructors and has no friends
bug.C:7: redefinition of `struct loop'
gcc: Internal compiler error: program cc1plus got fatal signal 15
138.2u 0.8s 2:20 99%
---------------------------------------------------------------------------

gcc has been installed without changes, but it has been compiled with "-O2" 
instead of the suggested "-g -O".

regards, Carsten.

  +---------------------------------------------------------+
  | Carsten Koch               E-Mail: carsten.koch@icem.de |
  | ICEM Systems GmbH          Phone:  +49-4264-2424        |
  | Waldsiedlung 7             Fax:    +49-4264-2464        |
  | 2730 Elsdorf-Hatzte, Germany                            |
  +---------------------------------------------------------+
Technical Details
Message-ID: <9211100835.AA00654@wald.hnv.icem.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!wald.UUCP!cko

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!wald.UUCP!cko
From: cko@wald.UUCP (Carsten Koch)
Subject: Doubly defined class brings compiler into infinite loop.
Message-ID: <9211100835.AA00654@wald.hnv.icem.de>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 10 Nov 1992 10:35:47 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 44