diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-09-27 05:41:29 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-09-27 05:41:29 +0000 |
commit | a80f7a710e9bb7f5873b197d127aa30630ce6e4f (patch) | |
tree | a5e1d7cb75910fdff29b9355daf45cc7c4cf5cb7 /gcc/go | |
parent | e75d8ec9c0008ce3388e91c952e6fe6ec953e21e (diff) | |
download | gcc-a80f7a710e9bb7f5873b197d127aa30630ce6e4f.zip gcc-a80f7a710e9bb7f5873b197d127aa30630ce6e4f.tar.gz gcc-a80f7a710e9bb7f5873b197d127aa30630ce6e4f.tar.bz2 |
compiler: Better error for missing comma in composite literal.
From-SVN: r191795
Diffstat (limited to 'gcc/go')
-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 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; |