public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100894] The std::common_reference implementation seems to be wrong Date: Tue, 10 Aug 2021 16:07:20 +0000 [thread overview] Message-ID: <bug-100894-4-Zq0IKMHHrp@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100894-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100894 --- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:0e54986854831a4c66b308f98aff949ca7d3ce84 commit r10-10026-g0e54986854831a4c66b308f98aff949ca7d3ce84 Author: Jonathan Wakely <jwakely@redhat.com> Date: Mon Jun 14 20:31:00 2021 +0100 libstdc++: Fix common_reference for non-reference results [PR100894] The result of COMMON-REF(A&, B&&) where they have no common reference type should be ill-formed. Our implementation fails to check that the COMMON-REF result is a reference, so is well-formed when it shouldn't be. This means that common_reference uses that result when it shouldn't do. The fix is to reject the result of COMMON-REF(A, B) if it's not a reference, so that common_reference falls through to the next case, which uses COND-RES, which yields the correct non-reference result. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/100894 * include/std/type_traits (__common_ref_impl<X&, Y&>): Only use the type if it's a reference. * testsuite/20_util/common_reference/100894.cc: New test. (cherry picked from commit c37b5ddcc88e0cc0f6a4ad609eda51021df0f6bb)
next prev parent reply other threads:[~2021-08-10 16:07 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-03 16:35 [Bug libstdc++/100894] New: " hewillk at gmail dot com 2021-06-14 17:25 ` [Bug libstdc++/100894] " redi at gcc dot gnu.org 2021-06-14 19:30 ` redi at gcc dot gnu.org 2021-06-14 20:17 ` cvs-commit at gcc dot gnu.org 2021-06-14 21:49 ` cvs-commit at gcc dot gnu.org 2021-08-10 16:07 ` cvs-commit at gcc dot gnu.org [this message] 2021-08-10 16:07 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-100894-4-Zq0IKMHHrp@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).