🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++
Article #405

Are Class Decl.'s Legal in Funcs ?

#405
From: Michael Tiemann
Date: Tue, 04 Apr 1989 22:14
28 lines
1143 bytes
   Swen Johnson (SJohnson.ElSegundo@Xerox.COM) asks, Is this legal?
   and notes that GNU C++ 1.32.0 does not handle it correctly.
   
   -------------------------------------------------------------------------
   #include <stream.h>
   
   void func() {
	   class My_Class {
		   int var;
		   public:
			   void doit() {
				   var = 1;
				   cout << "var = " << var << "\n";
				   };
			   };
	   My_Class my_object;
	   my_object.doit();
	   };
   
   main () {
	   func();
	   };
   -------------------------------------------------------------------------

It is legal, and GNU C++ 1.34.2 handles this file just fine.

Michael
Technical Details
Message-ID: <8904042214.AA07835@yahi.stanford.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!tiemann
References: <890403-150348-4532@Xerox>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!tiemann
From: tiemann@YAHI.STANFORD.EDU (Michael Tiemann)
Newsgroups: gnu.g++
Subject: Are Class Decl.'s Legal in Funcs ?
Message-ID: <8904042214.AA07835@yahi.stanford.edu>
Date: 4 Apr 89 22:14:31 GMT
References: <890403-150348-4532@Xerox>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: tiemann@lurch.stanford.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 28