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
<r...@gcc.gnu.org>:

https://gcc.gnu.org/g:0e54986854831a4c66b308f98aff949ca7d3ce84

commit r10-10026-g0e54986854831a4c66b308f98aff949ca7d3ce84
Author: Jonathan Wakely <jwak...@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 <jwak...@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)
  • [Bug libstdc++/100894] The std:... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to