aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/parse.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-03-24 00:40:21 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-03-24 00:40:21 +0000
commitfd68e6ba7254ebe7feeeafe1fd6686b2ada8eeff (patch)
tree91ab079953ca16f0b2e9827450815c431130b628 /gcc/go/gofrontend/parse.cc
parent5278672ca11d7be0cd93f224689f78687adb91ed (diff)
downloadgcc-fd68e6ba7254ebe7feeeafe1fd6686b2ada8eeff.zip
gcc-fd68e6ba7254ebe7feeeafe1fd6686b2ada8eeff.tar.gz
gcc-fd68e6ba7254ebe7feeeafe1fd6686b2ada8eeff.tar.bz2
Condition in if statement is not optional.
From-SVN: r171377
Diffstat (limited to 'gcc/go/gofrontend/parse.cc')
-rw-r--r--gcc/go/gofrontend/parse.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index 2e59149..e658899 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -3703,8 +3703,7 @@ Parse::return_stat()
location));
}
-// IfStat = "if" [ [ SimpleStat ] ";" ] [ Condition ]
-// Block [ "else" Statement ] .
+// IfStmt = "if" [ SimpleStmt ";" ] Expression Block [ "else" Statement ] .
void
Parse::if_stat()
@@ -3728,8 +3727,7 @@ Parse::if_stat()
{
if (this->peek_token()->is_op(OPERATOR_SEMICOLON))
this->advance_token();
- if (!this->peek_token()->is_op(OPERATOR_LCURLY))
- cond = this->expression(PRECEDENCE_NORMAL, false, false, NULL);
+ cond = this->expression(PRECEDENCE_NORMAL, false, false, NULL);
}
this->gogo_->start_block(this->location());