Commit 52943bfe authored by Russ Cox's avatar Russ Cox

gc: require if condition

R=ken2, r2
CC=golang-dev
https://golang.org/cl/4195045
parent 814075df
......@@ -640,10 +640,15 @@ if_stmt:
{
markdcl();
}
if_header loop_body
if_header
{
if($3->ntest == N)
yyerror("missing condition in if statement");
}
loop_body
{
$$ = $3;
$$->nbody = $4;
$$->nbody = $5;
// no popdcl; maybe there's an LELSE
}
......
// errchk $G $D/$F.go
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func main() {
if { // ERROR "missing condition"
}
if x(); { // ERROR "missing condition"
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment