-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from minux/master
为 gccgo.po 的 31 到 115 行构造范例,除了70和74行。
- Loading branch information
Showing
16 changed files
with
77 additions
and
0 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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
//po:MsgId "argument 1 must be a map" | ||
//po:MsgStr "实参必须是常数" | ||
|
||
package p | ||
|
||
func F() { | ||
delete(1, 2) | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/argument_of_Offsetof_implies_indirection_of_an_embedded_field.go
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 |
---|---|---|
@@ -1,3 +1,16 @@ | ||
//po:MsgId "argument of Offsetof implies indirection of an embedded field" | ||
//po:MsgStr "" | ||
|
||
package p | ||
|
||
import "unsafe" | ||
|
||
type T1 struct { | ||
X int | ||
} | ||
|
||
type T struct { | ||
*T1 | ||
} | ||
|
||
var x = unsafe.Offsetof(T{}.X) |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//po:MsgId "expected integer or boolean type" | ||
//po:MsgStr "需要整数或布尔类型" | ||
|
||
package p | ||
|
||
var x = ^3.14 |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//po:MsgId "expected pointer" | ||
//po:MsgStr "需要指针" | ||
|
||
package p | ||
|
||
var x = *nil |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//po:MsgId "incompatible types in binary expression" | ||
//po:MsgStr "二元表达式中类型不匹配" | ||
|
||
package p | ||
|
||
var x = "1" + 1 |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
//po:MsgId "integer division by zero" | ||
//po:MsgStr "被零除" | ||
|
||
package p | ||
|
||
var x = 1 | ||
var y = x / 0 |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//po:MsgId "invalid comparison of nil with nil" | ||
//po:MsgStr "gimple 条件中比较代码无效" | ||
|
||
package p | ||
|
||
var x = nil == nil |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//po:MsgId "invalid type for make function" | ||
//po:MsgStr "函数%q+#D的抽象返回类型无效" | ||
|
||
package p | ||
|
||
var x = make(int) |
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 |
---|---|---|
@@ -1,3 +1,12 @@ | ||
//po:MsgId "invalid use of method value as argument of Offsetof" | ||
//po:MsgStr "使用模板名%qE时不带实参表无效" | ||
|
||
package p | ||
|
||
import "unsafe" | ||
|
||
type T struct{} | ||
|
||
func (T) F() {} | ||
|
||
var x = unsafe.Offsetof(T{}.F) |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
//po:MsgId "invalid use of %<...%> with builtin function" | ||
//po:MsgStr "内建函数实参无效" | ||
|
||
package p | ||
|
||
func F() { | ||
chans := []chan bool{} | ||
close(chans...) | ||
} |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
//po:MsgId "len larger than cap" | ||
//po:MsgStr "" | ||
|
||
package p | ||
|
||
var x = make([]byte, 10, 1) |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
//po:MsgId "negative shift count" | ||
//po:MsgStr "移位次数为负" | ||
|
||
package p | ||
|
||
var x = 1 | ||
var y = x >> -1 |
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
//po:MsgId "not enough arguments" | ||
//po:MsgStr "实参太少" | ||
|
||
package p | ||
|
||
func F(int, int, int) int | ||
|
||
var x = F(1, 2) |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
//po:MsgId "shift count not unsigned integer" | ||
//po:MsgStr "switch 语句中的值不是一个整数" | ||
|
||
package p | ||
|
||
var x = 1 | ||
var y = 1 >> x |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
//po:MsgId "shift of non-integer operand" | ||
//po:MsgStr "非整数操作数使用了操作数代码‘%c’" | ||
|
||
package p | ||
|
||
var x float32 | ||
var y = x << 2 |
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
//po:MsgId "too many arguments" | ||
//po:MsgStr "实参太多" | ||
|
||
package p | ||
|
||
func F() int | ||
|
||
var x = F(1) |