Need Kind Help

J.H.M.Dassen jdassen@wi.leidenuniv.nl
Fri May 8 00:56:00 GMT 1998


[Courtesy copy of Usenet posting]
Srivastava <srivastava@websci.com> wrote:
>Pl. Give Some guidelines for Manipulators  and Applicators.
>I possible one example code with output.I have compiled the following
>code

The information you provide would normally not be enough to help track down
this problem; you did not mention 
- what UNIX (vendor, version)
- which version of gcc you used
- what command line you used
etc.

However, in this case, the error seems to be easily reproducable.

>in UNIX and I got Internal Compiler error 40.
>#include<iostream.h>
>#include<fstream.h>
>#include<iomanip.h>
>template <class T>
>class VOMainp
>{
>typedef 
>	ostream& (*ACTION)(ostream&,T);
>friend
>	ostream& operator<<(ostream&,VOMainp<T>&)
>	{
>	return vm.act(os,vm.t);
>	}
>public:
>	VOMainp(ACTION f,T v):act(f),t(v)
>	{}
>private:
>	T t;
>	ACTION act;
>};
>template <class T>
>ostream& Action(ostream& os,int w)
>{
>	os.fill('*');
>	os.width(w);
>	return os;
>}
>VOMainp<int> FillAndWidth(int i)
>{
>	return VOMainp<int>(Action,i);
>}
>int main()
>{
>cout<<FillAndWidth(5)<<13;
>}

I've reproduced it on a Debian GNU/Linux "hamm" system (Linux 2.0.33,
libc6):

Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.90.28/specs
gcc version egcs-2.90.28 980423 (egcs-1.0.3 prerelease)
 /usr/lib/gcc-lib/i486-linux/egcs-2.90.28/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=90 -Di386 -D__ELF__ -Dunix -Dlinux -D__i386__ -D__ELF__ -D__unix__ -D__linux__ -D__i386 -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Wall -Di386 -Di486 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -D__i486__ -Asystem(unix) -Acpu(i386) -Amachine(i386) bar.cc /tmp/cca17420.ii
GNU CPP version egcs-2.90.28 980423 (egcs-1.0.3 prerelease) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/g++
 /usr/lib/gcc-lib/i486-linux/egcs-2.90.28/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i486-linux/egcs-2.90.28/cc1plus /tmp/cca17420.ii -quiet -dumpbase bar.cc -Wall -version -o /tmp/cca17420.s
GNU C++ version egcs-2.90.28 980423 (egcs-1.0.3 prerelease) (i486-linux) compiled by GNU C version egcs-2.90.28 980423 (egcs-1.0.3 prerelease).
bar.cc: In method `VOMainp<int>::VOMainp(class ostream & (*)(class ostream &, int), int)':
bar.cc:18: warning: member initializers for `int VOMainp<int>::t'
bar.cc:19: warning:   and `class ostream & (* VOMainp<int>::act)(class ostream &, int)'
bar.cc:15: warning:   will be re-ordered to match declaration order
bar.cc: In function `class VOMainp<int> FillAndWidth(int)':
bar.cc:30: Internal compiler error 40.
bar.cc:30: Please submit a full bug report to `egcs-bugs@cygnus.com'.

Ray
-- 
Obsig: developing a new sig



More information about the Gcc-bugs mailing list