[egcs-2.92.11 19980921] Problem with STL list persists.

Hyman Rosen hymie@prolifics.com
Fri Sep 25 13:18:00 GMT 1998


The following code still fails to compile with the current snapshot.

//------------------------- h.cc ---------------------------//
#include <list>

class a
{
	int x, y;
public:
	a(int x, int y) : x(x), y(y) { }
};

int main()
{
	list<a> b;

	b.push_back(a(1,2));
}
//----------------------------------------------------------//

Here are the error messages, for the command 'gcc h.cc':

#------------------------------------------------------------#
/egcs/include/g++-2/stl_construct.h: In function `void construct<a>(class a *)':
/egcs/include/g++-2/stl_list.h:303:   instantiated from `list<a,allocator<a> >::_M_create_node()'
/egcs/include/g++-2/stl_list.h:344:   instantiated from `list<a,allocator<a> >::insert(_List_iterator<a,a &,a *>, const a &)'
/egcs/include/g++-2/stl_list.h:381:   instantiated from `list<a,allocator<a> >::push_back(const a &)'
h.cc:14:   instantiated from here
/egcs/include/g++-2/stl_construct.h:53: no matching function for call to `a::a ()'
h.cc:8: candidates are: a::a(const a &)
h.cc:7:                 a::a(int, int)
#------------------------------------------------------------#



More information about the Gcc-bugs mailing list