ICE for 19980425: problem with template function as arg to for_each

andrew james robbie ajrobb@ee.mu.OZ.AU
Tue Apr 28 22:30:00 GMT 1998


Hi,
I consistently get 

	template1.cc: In function `int main()':
	template1.cc:17: Internal compiler error.
	template1.cc:17: Please submit a full bug report to `egcs-bugs@cygnus.com'.

in the code snippet below. Configuration is snapshot 19980425,
sparc-sun-solaris2.6, and --enable-shared.

Thanks,
Andrew

----

#include	<set>
#include	<algorithm>
#include	<iostream>
#include	<cstdlib>

template <class X> void show(X);

int
main(void) {

	set<int> s1;

	int one = 1;
	show(one);

	for_each(s1.begin(), s1.end(), show);

	return EXIT_SUCCESS;
}

template <class X>
void
show(X item) {
	cout << item << endl;
}


----





More information about the Gcc-bugs mailing list