From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4992B388B00F; Tue, 2 Jun 2020 17:13:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4992B388B00F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591118039; bh=BeB5LEgqm13QxuybuTsv+WnxwSfr+L0qhQ9CAEuRRK4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UDhOigKUkqzl5dW8nOd/WsS3G4sW3bMzW9Vkwr9HAddQs3n5JuMwOl1V+eHp1AeHI +x7PFpzGX04V0wq8nhZOEWHYNnszEfQmDO62n59IWDuWqfQHsyf7mEg1hHjq05aWRy 4sdXMw6isCFT7qdAFGQpSusTcEhDOuBumYeVXATE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/90102] Incorrect ambiguous overload with _GLIBCXX_DEBUG Date: Tue, 02 Jun 2020 17:13:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 8.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2020 17:13:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90102 --- Comment #6 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:eca833b81289438ec5ae3ed4c77ffb49cfb65f34 commit r11-832-geca833b81289438ec5ae3ed4c77ffb49cfb65f34 Author: Jonathan Wakely Date: Tue Jun 2 18:13:08 2020 +0100 libstdc++: Make debug containers prefer copy ctor to base ctor (PR 9010= 2) When given a type which can convert to any container-like type, the C(const C&) copy constructor and C(const C::_Base&) converting constructor are ambiguous. This change replaces the converting constructor's parameter with a reference_wrapper-like type so that calling that constructor requires an additional user-defined conversion. This gives it a lower rank than the copy constructor, avoiding the ambiguity. While testing this change I discovered that __gnu_debug::forward_list doesn't have a convering constructor from the std::forward_list base, so this adds it. We should probably consider whether the converting constructors should be 'explicit' but I'm not changing that now. libstdc++-v3/ChangeLog: PR libstdc++/90102 * include/debug/deque (deque(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/forward_list (forward_list(_Base_ref)): New constructor. * include/debug/list (list(const _Base&)): Replace parameter with a struct that wraps a const _Base&. * include/debug/map.h (map(const _Base&)): Likewise. * include/debug/multimap.h (multimap(const _Base&)): Likewise. * include/debug/multiset.h (multiset(const _Base&)): Likewise. * include/debug/set.h (set(const _Base&)): Likewise. * include/debug/unordered_map (unordered_map(const _Base&)) (unordered_multimap(const _Base&)): Likewise. * include/debug/unordered_set (unordered_set(const _Base&)) (unordered_multiset(const _Base&)): Likewise. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adjust dg-error line number. * include/debug/vector (vector(const _Base&)): Likewise. * testsuite/23_containers/deque/debug/90102.cc: New test. * testsuite/23_containers/forward_list/debug/90102.cc: New test. * testsuite/23_containers/list/debug/90102.cc: New test. * testsuite/23_containers/map/debug/90102.cc: New test. * testsuite/23_containers/multimap/debug/90102.cc: New test. * testsuite/23_containers/multiset/debug/90102.cc: New test. * testsuite/23_containers/set/debug/90102.cc: New test. * testsuite/23_containers/unordered_map/debug/90102.cc: New tes= t. * testsuite/23_containers/unordered_multimap/debug/90102.cc: New test. * testsuite/23_containers/unordered_multiset/debug/90102.cc: New test. * testsuite/23_containers/unordered_set/debug/90102.cc: New tes= t. * testsuite/23_containers/vector/debug/90102.cc: New test.=