aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/parse.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index cfcc00f..f6b9715 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;