From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23984 invoked by alias); 23 Jan 2013 16:25:46 -0000 Received: (qmail 23591 invoked by uid 48); 23 Jan 2013 16:25:18 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56084] poor error recovery for missing ";" Date: Wed, 23 Jan 2013 16:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Last reconfirmed Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg02182.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56084 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-01-23 Ever Confirmed|0 |1 --- Comment #2 from Jonathan Wakely 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.)