From 3878c9de28c8b2a9b9b5dd955e2208c2261f9cc2 Mon Sep 17 00:00:00 2001 From: ian Date: Thu, 27 Sep 2012 05:41:29 +0000 Subject: compiler: Better error for missing comma in composite literal. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191795 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/parse.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/go') diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index cfcc00f99ee..f6b9715d4c1 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; -- cgit v1.2.1