https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88011

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmpf.  Somehow cut&pasting the GCD library part into the testcase doesn't work:

gcdbug.go:18:7: error: may not define methods on non-local type
 func (z *Int) mYlehmerGCD(x, y, a, b *Int) *Int {
       ^
gcdbug.go:129:7: error: may not define methods on non-local type
 func (z *Int) mYGCD(x, y, a, b *Int) *Int {
       ^
gcdbug.go:39:6: error: reference to unexported field or method ‘abs’
  if A.abs.cmp(B.abs) < 0 {
      ^
gcdbug.go:39:16: error: reference to unexported field or method ‘abs’
  if A.abs.cmp(B.abs) < 0 {
                ^

I guess the errors about abs() are spurious.  How can I fixup

func (z *Int) mYlehmerGCD(x, y, a, b *Int) *Int {
        var A, B, Ua, Ub *Int


to not be "method on non-local type"?  Like a simple function?  And how to
adjust callers?  I've also cut&pasted

func (z *Int) mYGCD(x, y, a, b *Int) *Int {
        if a.Sign() <= 0 || b.Sign() <= 0 {
...

with similar issues.

Reply via email to