projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e75d8ec
)
compiler: Better error for missing comma in composite literal.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 27 Sep 2012 05:41:29 +0000
(
05:41
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 27 Sep 2012 05:41:29 +0000
(
05:41
+0000)
From-SVN: r191795
gcc/go/gofrontend/parse.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/parse.cc
b/gcc/go/gofrontend/parse.cc
index cfcc00f99ee4b01efa9a821a40503a9c993e4944..f6b9715d4c1ed1e2934fff486b56ba7683749121 100644
(file)
--- 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;