projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
117614a
)
Better error message for missing condition in if statement.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Mon, 28 Mar 2011 22:58:49 +0000
(22:58 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Mon, 28 Mar 2011 22:58:49 +0000
(22:58 +0000)
From-SVN: r171638
gcc/go/gofrontend/parse.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/parse.cc
b/gcc/go/gofrontend/parse.cc
index 1120c1e48274ce3f13a78349398bc4b5adf2d71e..c7cd1087b803b5dc5d6446f8e8e94e2d83417190 100644
(file)
--- a/
gcc/go/gofrontend/parse.cc
+++ b/
gcc/go/gofrontend/parse.cc
@@
-3779,6
+3779,12
@@
Parse::if_stat()
if (!this->expression_may_start_here())
cond = Expression::make_error(this->location());
}
+ if (cond == NULL && this->peek_token()->is_op(OPERATOR_LCURLY))
+ {
+ error_at(this->location(),
+ "missing condition in if statement");
+ cond = Expression::make_error(this->location());
+ }
if (cond == NULL)
cond = this->expression(PRECEDENCE_NORMAL, false, false, NULL);
}