[gnu.g++.bug] Type Check Bug in G++ 1.27.0

zhao@wiener.usc.edu (11/08/88)

I believe the following example demonstrates a bug in the type checking of
g++ 1.27.0.

Machine: SUN3/60M  OS: 3.4

[1]: cat bug.cc
// File bug.cc
class foo {
private:
  int s1, s2;
public:
  foo () { s1 = 0; s2 = 0; }
  void set1 (int l);
  void set2 (int l);
};

void foo::set1 (int l) { s1 = l; }

void foo::set2 (int l) { s2 = l; }

foo BAR;

void test ()
{
  BAR.set1 (1);
  set2 (2);	   // <<---- Compiler should issue warning here.
}

[2]: g++ -c -v bug.cc
g++ version 1.27.0
 /usr/local/lib/gcc-cpp+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix bug.cc /tmp/cca16246.cpp
GNU CPP version 1.27.0
 /usr/local/lib/gcc-c++ /tmp/cca16246.cpp -quiet -dumpbase bug.cc -noreg -version -o /tmp/cca16246.s
GNU C++ version 1.27.0 (68k, MIT syntax) compiled by GNU C version 1.27.
 as -mc68020 /tmp/cca16246.s -o bug.o
[3]: exit


No warning message is issued even though an obvious syntax error is presented.

zhao@wiener.usc.edu (11/08/88)

I apologize for the mistake in my previous post. After examming the assembly
codes, I realized that it really shouldn't be called a serious bug though a 
warning message might be better.