🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

BUG in G++ 1.35-.0- (b047)

#1939
From: Ron Guilmette
Date: Wed, 03 May 1989 20:57
89 lines
4012 bytes
The compiler does not check that type conversion operators must
have at least one argument.

It also looks like the error messages could be made more consistant
for all of the following cases.

b047 had missed error(s) as follows:
	36: int operator int ();		// ERROR
	38: base operator base ();		// ERROR
b047: FAILED
-------------------------------------------------------------------
// Check that it is illegal to declare unary operators with
// less than one argument.  Check type conversions as well
// as normal operators.

struct base {
	int member;
};

// Unary +
int operator + ();		// ERROR

// unary -
int operator - ();		// ERROR

// unary & (i.e. address of)
int operator & ();		// ERROR

int operator ~ ();		// ERROR

int operator ! ();		// ERROR

int operator ++ ();		// ERROR

int operator -- ();		// ERROR

int operator [] ();		// ERROR

int operator () ();		// ERROR

int operator -> ();		// ERROR

void* operator new ();		// ERROR

void operator delete ();	// ERROR

int operator int ();		// ERROR

base operator base ();		// ERROR
----------------------------------------------------------------------------
/usr/local/src/src/g++/build/sun3/1.35-.0-.0/g++ -B/usr/local/src/src/g++/build/sun3/1.35-.0-.0/ -Wall -Wwrite-strings -g -S -v b047.C
g++ version 1.35.0-.0
 /usr/local/src/src/g++/build/sun3/1.35-.0-.0/cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Wall -D__HAVE_68881__ -Dmc68020 b047.C /tmp/cca20720.cpp
GNU CPP version 1.35.0-.0
 /usr/local/src/src/g++/build/sun3/1.35-.0-.0/c++ /tmp/cca20720.cpp -quiet -dumpbase b047.C -Wall -Wwrite-strings -noreg -version -G -o b047.s
GNU C++ version 1.35.0-.0 (68k, MIT syntax) compiled by GNU C version 1.34.1.
b047.C:10: wrong number of parameters to `operator +'
b047.C:10: `operator +' must have at least one class type
b047.C:10: operator has no  user-defined argument type
b047.C:13: wrong number of parameters to `operator -'
b047.C:13: `operator -' must have at least one class type
b047.C:13: operator has no  user-defined argument type
b047.C:16: wrong number of parameters to `operator &'
b047.C:16: `operator &' must have at least one class type
b047.C:16: operator has no  user-defined argument type
b047.C:18: wrong number of parameters to `operator ~'
b047.C:18: `operator ~' must have at least one class type
b047.C:18: operator has no  user-defined argument type
b047.C:20: wrong number of parameters to `operator !'
b047.C:20: `operator !' must have at least one class type
b047.C:20: operator has no  user-defined argument type
b047.C:22: `operator ++' must have at least one class type
b047.C:22: operator has no  user-defined argument type
b047.C:24: `operator --' must have at least one class type
b047.C:24: operator has no  user-defined argument type
b047.C:26: wrong number of parameters to `operator []'
b047.C:26: `operator []' must have at least one class type
b047.C:26: operator has no  user-defined argument type
b047.C:28: `operator ()' must have at least one class type
b047.C:28: operator has no  user-defined argument type
b047.C:30: `operator ->' must have at least one class type
b047.C:30: operator has no  user-defined argument type
b047.C:32: operator has no  user-defined argument type
b047.C:32: conflicting types for `void *__builtin_new ()'
(null):0: previous declaration of `void *__builtin_new (long int)'
b047.C:34: operator has no  user-defined argument type
b047.C:34: conflicting types for `void __builtin_delete ()'
(null):0: previous declaration of `void __builtin_delete (void *)'
Technical Details
Message-ID: <8905032057.AA20742@riunite.aca.mcc.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MCC.COM!rfg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MCC.COM!rfg
From: rfg@MCC.COM (Ron Guilmette)
Newsgroups: gnu.g++.bug
Subject: BUG in G++ 1.35-.0- (b047)
Message-ID: <8905032057.AA20742@riunite.aca.mcc.com>
Date: 3 May 89 20:57:04 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 89