aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-11-28 18:51:05 -0800
committerIan Lance Taylor <iant@golang.org>2020-11-30 12:14:23 -0800
commit5ba975e6680cc5f9c2be7ee34b1cacdba3eb3347 (patch)
tree3c1a0b173e9fb504001b6f3480ea6726c48ec4dd /gcc/go
parentc7f272e05e1cf8c7d7caefe5ee542845cf4cc7c8 (diff)
downloadgcc-5ba975e6680cc5f9c2be7ee34b1cacdba3eb3347.zip
gcc-5ba975e6680cc5f9c2be7ee34b1cacdba3eb3347.tar.gz
gcc-5ba975e6680cc5f9c2be7ee34b1cacdba3eb3347.tar.bz2
compiler: improve error messages for expected curly brace
For golang/go#17328 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273890
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/parse.cc6
2 files changed, 4 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index e2fc0b5..4124603 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-213abeedc85ed638a878f9457e422897fda3a111
+45461eeba1db1a3b4194dc8ecc331c0e92f5ad4c
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index 1dac002..c9a5485 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -4422,7 +4422,7 @@ Parse::if_stat()
{
Location semi_loc = this->location();
if (this->advance_token()->is_op(OPERATOR_LCURLY))
- go_error_at(semi_loc, "missing %<{%> after if clause");
+ go_error_at(semi_loc, "unexpected semicolon or newline, expecting %<{%> after if clause");
// Otherwise we will get an error when we call this->block
// below.
}
@@ -5359,7 +5359,7 @@ Parse::for_stat(Label* label)
{
Location semi_loc = this->location();
if (this->advance_token()->is_op(OPERATOR_LCURLY))
- go_error_at(semi_loc, "missing %<{%> after for clause");
+ go_error_at(semi_loc, "unexpected semicolon or newline, expecting %<{%> after for clause");
// Otherwise we will get an error when we call this->block
// below.
}
@@ -5430,7 +5430,7 @@ Parse::for_clause(Expression** cond, Block** post)
*cond = NULL;
else if (this->peek_token()->is_op(OPERATOR_LCURLY))
{
- go_error_at(this->location(), "missing %<{%> after for clause");
+ go_error_at(this->location(), "unexpected semicolon or newline, expecting %<{%> after for clause");
*cond = NULL;
*post = NULL;
return;