🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Compiler error 62 on typedef within base class

#1034
From: mrhagger
Date: Wed, 07 Oct 1992 22:35
52 lines
2038 bytes
I am using the emx port of gcc 2.2.2 under OS/2 2.0.  The system was
downloaded from ftp-os2.nmsu.edu in compiled form a couple of weeks 
ago and is used without modification.
 
The following file triggers an "internal compiler error 62".  The
session and gcc's output follow the program text.
 
===========================================================================
class A
{
  public:
    typedef void (*void_fn)();
};
 
class B : public A
{
  public:
    void func(void_fn f);
};
---------------------------------------------------------------------------
[c:\emx\gnu\bugs]gcc -v -c bug2.cc
gcc version 2.2.2
 cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__32BIT__ -D_
_EMX__ -Di386 -D__32BIT__ -D__EMX__ -D__i386__ -D__32BIT__ -D__EMX__ -D__i386 bu
g2.cc ./cca00153.i
GNU CPP version 2.2.2 (80386, BSD syntax)
 cc1plus ./cca00153.i -quiet -dumpbase bug2.cc -version -o ./cca00153.s
GNU C++ version 2.2.2 (80386, BSD syntax) compiled by GNU C version 2.2.2.
bug2.cc:10: internal compiler error 62, please report
 
[c:\emx\gnu\bugs]
===========================================================================
 
A workaround is to use the scope-resolution operator in front of
the typedef name usage, as follows (now it compiles fine):
 
===========================================================================
class A
{
  public:
    typedef void (*void_fn)();
};
 
class B : public A
{
  public:
    void func(A::void_fn f);
};
===========================================================================
 
Michael Haggerty
mrhagger@athena.mit.edu
Technical Details
Message-ID: <9210072235.AA02417@alfredo>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!athena.mit.edu!mrhagger

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!athena.mit.edu!mrhagger
From: mrhagger@athena.mit.edu
Subject: Compiler error 62 on typedef within base class
Message-ID: <9210072235.AA02417@alfredo>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 7 Oct 1992 22:35:13 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 53