ERROR Using Named Return Values in C++
Achim Hummel
achim.hummel@TalkNet.de
Sat Apr 3 17:18:00 GMT 1999
Hi,
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,
Achim
--------------------------------------------------------------
Here the additional stuff:
--------------------------------------------------------------
Reading specs from
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.66/cpp
-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.cc bug.ii
GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i386
Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/egcs/include/g++
/usr/local/include
/usr/local/egcs/i686-pc-linux-gnulibc1/include
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.66/include
/usr/include
End of search list.
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.66/cc1plus
bug.ii -quiet -dumpbase bug.cc -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 {
public:
int method();
};
template<class T> int
A<T>::method() return a;
{
a = 3;
}
int
main()
{
A<int> a;
a.method();
}
More information about the Gcc-bugs
mailing list