[gnu.g++] Are Class Decl.'s Legal in Funcs ?

tiemann@YAHI.STANFORD.EDU (Michael Tiemann) (04/05/89)

   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