public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/100387] New: ranges::minmax compares moved-out value
@ 2021-05-02 16:54 hewillk at gmail dot com
  2021-05-02 17:11 ` [Bug libstdc++/100387] " hewillk at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hewillk at gmail dot com @ 2021-05-02 16:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100387
           Summary: ranges::minmax compares moved-out value
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

In ranges_algo.h#L3301:

  if (std::__invoke(__comp,
                    std::__invoke(__proj, __tmp),
                    std::__invoke(__proj, __result.min)))
    __result.min = std::move(__tmp);
  if (!(bool)std::__invoke(__comp,
                           std::__invoke(__proj, __tmp),
                           std::__invoke(__proj, __result.max)))
    __result.max = std::move(__tmp);

we compare the moved-out __tmp in the second if statement.
test: https://godbolt.org/z/W6WTG6sdG

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

end of thread, other threads:[~2021-10-12 18:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-02 16:54 [Bug libstdc++/100387] New: ranges::minmax compares moved-out value hewillk at gmail dot com
2021-05-02 17:11 ` [Bug libstdc++/100387] " hewillk at gmail dot com
2021-05-03 14:08 ` ppalka at gcc dot gnu.org
2021-05-04 14:45 ` ppalka at gcc dot gnu.org
2021-06-18 23:34 ` cvs-commit at gcc dot gnu.org
2021-07-13 14:03 ` cvs-commit at gcc dot gnu.org
2021-10-12 18:37 ` cvs-commit at gcc dot gnu.org
2021-10-12 18:40 ` ppalka at gcc dot gnu.org
2021-10-12 18:59 ` ppalka 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).