I don't think this is your real code, but here's my guess:
ostream& operator<<(ostream& os, const MyList& l)
// |
// note const
Either that, or something really dumb like forgetting a trailing ;
:
class A {
public:
MyList list;
void someMethod();
}; // <------- here