This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: New name mangling in g++
On Jan 29, 2001, Andreas Schwab <schwab@suse.de> wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
> |> On Mon, Jan 29, 2001 at 05:32:59PM +0100, Andreas Schwab wrote:
> |> > The `const' is not part of the interface.
> |> const is part of the interface, it is encoded with the K.
> Since argument b is passed by value, the const should not matter, should
> it?
It shouldn't and doesn't matter. ``Any cv-qualifier modifying a
parameter type is deleted. [Example: type type void(*)(const int)
becomes void(*)int --end example] Such cv-qualifiers affect only the
definition of the parameter within the body of the function; they do
not affect the function type.'' [dcl.fct]/3
Obviously, only the top-level cv-qualifier is discarded. The `const'
of `char const*', for example, is not discarded, because the
cv-qualifier doesn't directly modify the parameter type.
--
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