mirror of
https://github.com/golang/go
synced 2024-11-22 01:04:40 -07:00
print(1<<x)
R=ken OCL=32252 CL=32252
This commit is contained in:
parent
30228a3bc6
commit
059bbdd340
@ -94,7 +94,7 @@ convlit1(Node **np, Type *t, int explicit)
|
|||||||
break;
|
break;
|
||||||
case OLSH:
|
case OLSH:
|
||||||
case ORSH:
|
case ORSH:
|
||||||
convlit(&n->left, t);
|
convlit1(&n->left, t, explicit);
|
||||||
n->type = n->left->type;
|
n->type = n->left->type;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -858,7 +858,8 @@ reswitch:
|
|||||||
defaultlit(&n->right, types[TUINT]);
|
defaultlit(&n->right, types[TUINT]);
|
||||||
if(n->left->type == T || n->right->type == T)
|
if(n->left->type == T || n->right->type == T)
|
||||||
goto ret;
|
goto ret;
|
||||||
if(issigned[n->right->type->etype] || !isint[n->right->type->etype])
|
et = n->right->type->etype;
|
||||||
|
if(issigned[et] || !isint[et])
|
||||||
goto badt;
|
goto badt;
|
||||||
// check of n->left->type happens in second switch.
|
// check of n->left->type happens in second switch.
|
||||||
break;
|
break;
|
||||||
@ -2500,14 +2501,14 @@ prcompat(NodeList *all, int fmt, int dopanic)
|
|||||||
switch(n->val.ctype) {
|
switch(n->val.ctype) {
|
||||||
case CTINT:
|
case CTINT:
|
||||||
defaultlit(&n, types[TINT64]);
|
defaultlit(&n, types[TINT64]);
|
||||||
l->n = n;
|
|
||||||
break;
|
break;
|
||||||
case CTFLT:
|
case CTFLT:
|
||||||
defaultlit(&n, types[TFLOAT64]);
|
defaultlit(&n, types[TFLOAT64]);
|
||||||
l->n = n;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
defaultlit(&n, nil);
|
||||||
|
l->n = n;
|
||||||
if(n->type == T)
|
if(n->type == T)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
12
test/fixedbugs/bug174.go
Normal file
12
test/fixedbugs/bug174.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// $G $D/$F.go || echo BUG: bug174
|
||||||
|
|
||||||
|
// 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 main() {
|
||||||
|
var x uint;
|
||||||
|
println(1<<x);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user