This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug go/66431] [go] Unexpected function return value after it is redefined in closure
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 05 Jun 2015 13:26:38 +0000
- Subject: [Bug go/66431] [go] Unexpected function return value after it is redefined in closure
- Auto-submitted: auto-generated
- References: <bug-66431-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66431
Ian Lance Taylor <ian at airs dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Ian Lance Taylor <ian at airs dot com> ---
This is not a bug in either toolchain. The Go language does not fully specify
the order of evaluation. In the line
return value, closure()
it is not specified whether value is read before after closure is called. The
two toolchains are making different choices. Both are correct. The program is
indeterminate.
This is already explained at the code.google.com link that you attached.