diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-27 05:41:46 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-27 05:41:46 +0000 |
commit | fe7be149f78b8eafb73b5eae65e4ed8b00d833b7 (patch) | |
tree | 331a296233ccf777d15be846ec9c8167add6dd09 | |
parent | 13f4ae5c3edf0be4ad34cbb433023eb57d127a78 (diff) | |
download | gcc-fe7be149f78b8eafb73b5eae65e4ed8b00d833b7.tar.gz |
compiler: Better error for missing comma in composite literal.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@191796 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/go/gofrontend/parse.cc | 6 |
1 files changed, 5 insertions, 1 deletions
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; |