Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!cs.utexas.edu!tut.cis.ohio-state.edu!kimber.ai.mit.edu!kimber
From: kimber@kimber.ai.mit.edu (Don Kimber EIL)
Newsgroups: gnu.g++.bug
Subject: `this' is read-only in 1.36.0-
Message-ID: <8908170149.AA02564@briard.parc.xerox.com>
Date: 17 Aug 89 01:49:08 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 34

In version 1.36.0- on a Sun 4, running 4.0.1, the program foo.cc


  class cl* my_allocater(int size);
  void my_free(class cl* ptr);

  class cl {
  public:
     cl() {
       this = my_allocater( sizeof(cl) );
     };
     ~cl() {
       my_free( this );
       this = 0;
     };
  };

Gets the following errors
% g++ -v foo.cc
g++ version 1.36.0-
 /import/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__GNUC__ -D__cplusplus
-Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ foo.cc /tmp/cca02559.cpp
GNU CPP version 1.35.96
 /import/lib/gcc-cc1plus /tmp/cca02559.cpp -quiet -dumpbase foo.cc -noreg -versi
on -o /tmp/cca02559.s
GNU C++ version 1.36.0- (sparc) compiled by GNU C version 1.35.96.
default target switches: -mfpu -mepilogue
foo.cc: In method cl::cl ():
foo.cc:7: assignment of read-only parameter `$this'
foo.cc: In method cl::~cl ():
foo.cc:10: assignment of read-only parameter `$this'


Don Kimber