From: Ian Lance Taylor Date: Thu, 27 Sep 2012 05:41:29 +0000 (+0000) Subject: compiler: Better error for missing comma in composite literal. X-Git-Tag: misc/gccgo-go1_1_2~609 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a80f7a710e9bb7f5873b197d127aa30630ce6e4f;p=thirdparty%2Fgcc.git compiler: Better error for missing comma in composite literal. From-SVN: r191795 --- diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index cfcc00f99ee4..f6b9715d4c1e 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -2723,7 +2723,11 @@ Parse::composite_lit(Type* type, int depth, Location location) } else { - error_at(this->location(), "expected %<,%> or %<}%>"); + if (token->is_op(OPERATOR_SEMICOLON)) + error_at(this->location(), + "need trailing comma before newline in composite literal"); + else + error_at(this->location(), "expected %<,%> or %<}%>"); this->gogo_->mark_locals_used(); int depth = 0;