This is the mail archive of the gcc-bugs@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: Bug in 1.0.3


Robert Krawitz <rlk@rlk-ppp-1.torrent.com> writes:

> % g++ -c foo.C
> foo.C: In method `void foo<void *>::apply(void (*)(void *const &, void *), void *)':
> foo.C:40: Internal compiler error.
> foo.C:40: Please submit a full bug report to `egcs-bugs@cygnus.com'.

The latest snapshot prints instead:

test.cc: In method `void foo<void *>::apply<void *>(void (*)(void *const &, void *), void *)':
test.cc:43:   instantiated from here
test.cc:40: conversion from `void (*)(void *const &, void *)' to non-scalar type `{error}' requested

Unfortunately, this is not a very useful error message :-(

It took me some time to notice that the problem is that you're casting 
`void (*)(void *const &, void *)' to `void (*)(void *&, void*)', but
the argument list of helper0<void*>::apply expects a `void (*)(void
*const&, void*'.

Removing the apparently unnecessary cast causes the problem to go
away, even with egcs 1.0.3.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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