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

--- Comment #12 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:5c86e63cb0383a38ec3dea24e9b3fe2f6e312057

commit r10-10305-g5c86e63cb0383a38ec3dea24e9b3fe2f6e312057
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Tue Jul 20 15:20:41 2021 +0100

    libstdc++: fix is_default_constructible for hash containers [PR 100863]

    The recent change to _Hashtable_ebo_helper for this PR broke the
    is_default_constructible trait for a hash container with a non-default
    constructible allocator. That happens because the constructor needs to
    be user-provided in order to initialize the member, and so is not
    defined as deleted when the type is not default constructible.

    By making _Hashtable derive from _Enable_special_members we can ensure
    that the default constructor for the std::unordered_xxx containers is
    deleted when it would be ill-formed. This makes the trait give the
    correct answer.

    This backport to gcc-10 includes the fix for PR 101583.

    Signed-off-by: Jonathan Wakely <jwak...@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/100863
            * include/bits/hashtable.h (_Hashtable): Conditionally delete
            default constructor by deriving from _Enable_default_constructor.
            Construct that base-class explicitly in all non-forwarding,
            non-defaulted constructors.
            * testsuite/23_containers/unordered_map/cons/default.cc: New test.
            * testsuite/23_containers/unordered_set/cons/default.cc: New test.

    (cherry picked from commit 89ec3b67dbe856a447d068b053bc19559f136f43)

Reply via email to