]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: Better error for missing comma in composite literal.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 27 Sep 2012 05:41:29 +0000 (05:41 +0000)
committerIan 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

index cfcc00f99ee4b01efa9a821a40503a9c993e4944..f6b9715d4c1ed1e2934fff486b56ba7683749121 100644 (file)
@@ -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;