🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

BUG(s) in G++ 1.33.0 - misleading errors/warnings

#1699
From: Ron Guilmette
Date: Thu, 23 Feb 1989 00:59
72 lines
3094 bytes
The following short fragment of code demonstrates three independent
problems with g++ 1.33.0 (on a Sun 3).

a)	Errors do not prevent a .s or a .o file from being generated.
	They should.  Otherwise some (bad) Makefiles can do bad things.

b)	Errors in processing global level declarations cause strange
	looking error messages to be generated.  Specifically, in the
	example below, prior to one of the errors, I get:

	In function void _GLOBAL_$I$x02_cc ():

	I think that this function-identification stuff which generally
	preceeds error message groups for a given function is (obviously)
	nonsense at the global level and should be suppressed.

c)	The error messages issued for the case when a default constructor
	is needed but the one that exists is non-public are misleading
	and confusing.  They just say that there is no default constructor.
	In fact, there is one!  It's just not "visible" at the points where
	it needed to be.  The error messages should say that instead.

The code follows below.  After the code is a log showing the results of
compilation.

// Ron Guilmette  -  MCC  -  Experimental (parallel) Systems Kit Project
// 3500 West Balcones Center Drive,  Austin, TX  78759  -  (512)338-3740
// ARPA: rfg@mcc.com
// UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg

Cut here
----------------------------------------------------------------------
/*
Description - check that if a default constructor is need (e.g. at the point
		of an object declaration) and that if there is a constructor
		which takes zero arguments but which is non-public, a
		reasonable error message is issued.
*/

class base
{
    base();
    virtual ~base();
};
  
inline base::base() {}
inline base::~base() {}

class derived : base
{
public:
    derived();
    ~derived();
};
 
base base_object;

inline derived::derived() : ()
{
}
------------------------------------------------------------------------
/usr/local/src/src/g++/build/1.33.0.0/sun3/g++ -B/usr/local/src/src/g++/build/1.33.0.0/sun3/ -S -v x02.cc
g++ version 1.33.0
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 x02.cc /tmp/cca16143.cpp
GNU CPP version 1.32
 /usr/local/src/src/g++/build/1.33.0.0/sun3/c++ /tmp/cca16143.cpp -quiet -dumpbase x02.cc -noreg -version -o x02.s
GNU C++ version 1.33.0 (68k, MIT syntax) compiled by GNU C version 1.33.
In method struct derived *derived::derived ():
x02.cc:28: no default constructor defined for type `base'
In function void _GLOBAL_$I$x02_cc ():
x02.cc:24: no default constructor defined for type `base'
*** Error code 1 (ignored)
Technical Details
Message-ID: <8902230059.AA16154@riunite.aca.mcc.com>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!MCC.COM!rfg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!MCC.COM!rfg
From: rfg@MCC.COM (Ron Guilmette)
Newsgroups: gnu.g++.bug
Subject: BUG(s) in G++ 1.33.0 - misleading errors/warnings
Message-ID: <8902230059.AA16154@riunite.aca.mcc.com>
Date: 23 Feb 89 00:59:56 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 72