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]

Internal error using template function as parameter



egcs crashes when I pass a template function to a function taking a 
function argument, although providing my own temporary works fine.

Reading specs from /usr/local/lib/gcc-lib/i386-unknown-freebsdelf3.0/egcs-2.91.60/specs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
 /usr/local/lib/gcc-lib/i386-unknown-freebsdelf3.0/egcs-2.91.60/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -Di386 -Dunix -D__ELF__ -D__FreeBSD__ -D__i386__ -D__unix__ -D__ELF__ -D__FreeBSD__ -D__i386 -D__unix -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ crash_egcs.cc crash_egcs.ii
GNU CPP version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i386 FreeBSD/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/include
 /usr/local/i386-unknown-freebsdelf3.0/include
 /usr/local/lib/gcc-lib/i386-unknown-freebsdelf3.0/egcs-2.91.60/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i386-unknown-freebsdelf3.0/egcs-2.91.60/cc1plus crash_egcs.ii -quiet -dumpbase crash_egcs.cc -version -o crash_egcs.s
GNU C++ version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i386-unknown-freebsdelf3.0) compiled by GNU C version egcs-2.91.60 19981201 (egcs-1.1.1 release).
crash_egcs.cc: In function `int main()':
crash_egcs.cc:17: Internal compiler error 980715.
crash_egcs.cc:17: Please submit a full bug report to `egcs-bugs@cygnus.com'.
crash_egcs.cc:17: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.


# 1 "crash_egcs.cc"
template <class T> void
fn() {
}

void 
invoke_fn (void (*x)()) {
    x();
}

int
main() {
    void (*ptr)();
     
    ptr = fn<int>;
    invoke_fn(ptr);
     
    invoke_fn(fn<int>);
    return (0);
}



-- 
Work: <drew@plutotech.com>   | For those who don't, no explanation is possible.
Play: <drew@poohsticks.org>  | For those who do, no explanation is necessary.  
Home page: http://www.poohsticks.org/drew/">Home Page</a>


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