http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56084
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-01-23 Ever Confirmed|0 |1 --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-01-23 16:25:18 UTC --- This reduces to: struct ostream { }; struct A { int i; } ostream& operator<<(ostream& o, const A&) { return o; } int main() { A a; ostream o; o << a; } which still gives a poor error that doesn't identify the problem, but it doesn't give pages of errors because there is only one operator<< in scope x.cc:7:8: error: expected initializer before '&' token ostream& operator<<(ostream& o, const A&) { return o; } ^ x.cc: In function 'int main()': x.cc:13:7: error: no match for 'operator<<' (operand types are 'ostream' and 'A') o << a; ^ (Separately, I'm investigating whether there's some way to reduce the output when an invalid ostream operation is done, because the sheer number of overloads of operator<< causes pages of output due to G++'s verbose, and usually very useful, output describing argument deduction errors.)