🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

function typedef

#1022
From: Marco S Hyman
Date: Mon, 05 Oct 1992 04:20
26 lines
1368 bytes
The compiler indicates an error on the noted line when compiling this class:

	class X {
	  public:
	    typedef int * Y( int );	// error
	    Y * y;

	    typedef int * (*Z)( int );
	    Z z;
	};

The ARM ($7.1.3, pg 108) indicates that this is valid -- but the example is
not inside a class.  Cfront (2.0) does not complain.

// marc

g++ -v -c x.c
Reading specs from /usr/local/lib/gcc-lib/i386-sysv/2.2.2/specs
gcc version 2.2.2
 /usr/local/lib/gcc-lib/i386-sysv/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dunix -Di386 -D__unix__ -D__i386__ -D__unix -D__i386 x.c /usr/tmp/cca11620.i
GNU CPP version 2.2.2 (80386, ATT syntax)
 /usr/local/lib/gcc-lib/i386-sysv/2.2.2/cc1plus /usr/tmp/cca11620.i -quiet -dumpbase x.cc -version -o /usr/tmp/cca11620.s
GNU C++ version 2.2.2 (80386, ATT syntax) compiled by GNU C version 2.2.2.
x.c:3: field `Y' invalidly declared function type

Compilation exited abnormally with code 1 at Sun Oct  4 21:15:04
Technical Details
Message-ID: <9210050420.AA11649@dumbcat.sf.ca.us>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!dumbcat.sf.CA.US!marc

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!dumbcat.sf.CA.US!marc
From: marc@dumbcat.sf.CA.US (Marco S Hyman)
Subject: function typedef
Message-ID: <9210050420.AA11649@dumbcat.sf.ca.us>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 5 Oct 1992 04:20:59 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 27