forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Storing an out of range constant into a variable should
ideally cause the compiler to give an error. Right now 6g warns about large shifts but does not give an error. This CL removes the out of range shift from shift.go, so that it will work with gccgo, and adds a test case in bugs/ to be fixed at a later date. R=ken,r DELTA=23 (9 added, 14 deleted, 0 changed) OCL=16085 CL=16088
- Loading branch information
1 parent
89ac561
commit 08df4dc
Showing
3 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// errchk $G $D/$F.go | ||
|
||
// Copyright 2009 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 f() { | ||
v := 1 << 1025; // ERROR "overflow" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters