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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:302343d8dd30e34516f74a61ec758d80a6c4d1db

commit r12-6691-g302343d8dd30e34516f74a61ec758d80a6c4d1db
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Tue Jan 18 15:10:06 2022 +0000

    libstdc++: Fix ambiguous std::pair constructors [PR101124]

    The deprecated non-standard std::pair constructors that allow
    constructing std::pair<move-only-type, pointer-type> from an rvalue and
    a literal zero where not sufficiently constrained. They were viable when
    constructing std::pair<copyable-type, pointer-type>, and that case
    should work fine using the standard constructors.

    Replace the constraints on the non-standard constructors so they are
    only viable in cases that should actually be ill-formed according to the
    standard.

    Also rename __null_ptr_constant to __zero_as_null_pointer_constant so it
    matches the name of the -Wzero-as-null-pointer-constant warning. Also
    make the text of the deprecated warning describe the problem in more
    detail.

    libstdc++-v3/ChangeLog:

            PR libstdc++/101124
            * include/bits/stl_pair.h (pair): Adjust constraints on
            deprecated constructors accepting literal zero as null pointer
            constant. Improve wording of deprecated attribute.
            * testsuite/20_util/pair/cons/99957.cc: Check that deprecated
            constructors do not cause ambiguities for copyable types.

Reply via email to