ERROR Using Named Return Values in C++

Achim Hummel
Sat Apr 3 17:18:00 GMT 1999


I tried to using "named return values" together with templates
(extension to c++ language)
similar to the gcc user manual,  but the compiler crashed with a
internal compiler error in
the function expand_expr. Without templates everything works fine !

Is this a real error or just a wrong utilization of the code by myself?
If Yes, is (or will) there
be a workaround for that error ?

Thanks in advance,


Here the additional stuff:
Reading specs from
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
-lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus
-D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__
-D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux
-Asystem(posix) -D__EXCEPTIONS -Asystem(unix) -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686
-D__i686__ -D__pentiumpro -D__pentiumpro__ bug.ii
GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i386
#include "..." search starts here:
#include <...> search starts here:

End of search list.
bug.ii -quiet -dumpbase -version -o bug.s
GNU C++ version egcs-2.91.66 19990314 (egcs-1.1.2 release)
(i686-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.66 19990314
(egcs-1.1.2 release).
expr.c:5450: Internal compiler error in function expand_expr

programm data:

template<class T>
class A {

    int method();

template<class T> int
A<T>::method()  return a;
    a = 3;

    A<int> a;


More information about the Gcc-bugs mailing list