public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/110394] New: Lambda capture receives wrong value
@ 2023-06-24 15:51 jackyguo18 at hotmail dot com
  2023-06-24 15:53 ` [Bug c++/110394] " jackyguo18 at hotmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jackyguo18 at hotmail dot com @ 2023-06-24 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110394
           Summary: Lambda capture receives wrong value
           Product: gcc
           Version: 13.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jackyguo18 at hotmail dot com
  Target Milestone: ---

Note that this doesn't occur in Clang, and to my knowledge, disabling strict
aliasing and overflow would make no difference.

The code submitted here is actually part of a larger library. When I go to
debug it, a lambda in `GetKeys(int index, BUTTONS* keys)` captures the wrong
value for `index`--it should be 0, but it's 23.

Changing the capture type from value to reference causes the lambda to
inexplicably call the address 0x17 (decimal 23).

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-24 21:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-24 15:51 [Bug other/110394] New: Lambda capture receives wrong value jackyguo18 at hotmail dot com
2023-06-24 15:53 ` [Bug c++/110394] " jackyguo18 at hotmail dot com
2023-06-24 16:15 ` pinskia at gcc dot gnu.org
2023-06-24 16:25 ` pinskia at gcc dot gnu.org
2023-06-24 16:33 ` xry111 at gcc dot gnu.org
2023-06-24 21:21 ` jackyguo18 at hotmail dot com
2023-06-24 21:22 ` jackyguo18 at hotmail dot com
2023-06-24 21:24 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).