This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: calling member functions in const objects


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]