Article View: gnu.g++.bug
Article #2211(none)
From: Dave Bezold
Date: Wed, 21 Feb 1990 23:53
Date: Wed, 21 Feb 1990 23:53
61 lines
1897 bytes
1897 bytes
We have discovered the following problem in g++-1.36.1 (gcc version 1.36.1
(based on GCC 1.36)). This is related to using enum tag names as unique types
in the signatures of overloaded functions. I realize that this is a new
feature in C++ 2.0 and may not be yet implemented in this version of g++;
Thanks,
Dave Bezold (bezold@fluke.tc.com)
Here is an example program which causes the bug:
++++++++++++++++++++++++++++++++++++bug.cc++++++++++++++++++++++++++++++++++
#include <stream.h>
#include <stdlib.h>
enum MagUnits {uV, mV, V, kV, MV};
enum FreqUnits {Hz, kHz, MHz};
class SAMple
{
public:
void set (float, FreqUnits);
void set (float, MagUnits);
};
void SAMple::set(float f, MagUnits u)
{
cout << "set(float, MagUnits)\n";
}
void SAMple::set(float f, FreqUnits u)
{
cout << "set(float, FreqUnits)\n";
}
int main (int argc, char *argv[])
{
SAMple measurement;
measurement.set(1.0, MV);
measurement.set(50.0, MHz);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On a sun 3, the following output is generated (configured for sun3-os4):
> a.out
set(float, MagUnits)
set(float, MagUnits)
It should be:
> a.out
set(float, MagUnits)
set(float, FreqUnits)
On a sun 4, the following compiler error occurs (configured for sun4-os4):
> g++ bug.cc
/usr/tmp/cca00585.s:115:Unknown pseudo-op /usr/tmp/cca00585.s:115:Rest of line
ignored. 1st junk character valued 48. /lib/crt0.o: Undefined symbol _main
referenced from text segment
Technical Details
Message-ID:
<9002212353.AA00617@sirloin>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!tc.fluke.com!bezoldShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!tc.fluke.com!bezold From: bezold@tc.fluke.com (Dave Bezold) Newsgroups: gnu.g++.bug Subject: (none) Message-ID: <9002212353.AA00617@sirloin> Date: 21 Feb 90 23:53:04 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 61