From a80f7a710e9bb7f5873b197d127aa30630ce6e4f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 27 Sep 2012 05:41:29 +0000 Subject: [PATCH] compiler: Better error for missing comma in composite literal. From-SVN: r191795 --- gcc/go/gofrontend/parse.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.47.2