This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: calling member functions in const objects
- To: Howard Lew <hlew at encc dot com>
- Subject: Re: calling member functions in const objects
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 08 Aug 2000 22:22:58 -0300
- Cc: gcc at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <398F28B9.DB6B84EE@encc.com>
On Aug 7, 2000, Howard Lew <hlew@encc.com> wrote:
> testcode.cc: In method 'int OuterObject::getInnerObject(const OuterObject&)':
> testcode.cc:59: passing 'const OuterObject; as 'this' argument of 'int
> OuterObject::getInnerObject()' discards qualifiers
Indeed, your code is definitely ill-formed.
> This code causes a fatal compiler error on gcc 2.95.2, but slides by with
> a harmless warning on 2.81 (egcs).
GCC 2.8.1 was not EGCS. EGCS 1.0 was released about the same time as
GCC 2.8.1.
More to the point, you may be able to restore that error to the status
of warning with -fpermissive, but you'd better fix your code.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me