From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 61C443858C83; Fri, 23 Sep 2022 22:22:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61C443858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663971764; bh=HuqtuucVJr5ctENF03JALzQrD7J+tFGgUtUvowj6dEI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Gncqqibjv4IHem3q5nW8FTm7dWGghEpf+p2D20O0ogLINDT47kseXpi7g6k6Nnoob OwIRCTaqMFkBoN0BXKcDRwJK1lXt6csK6LbDsifYbUd3ADrdA6UdAuOFNxlzoQHpCx /49zxmNkQu1GftVaqzZj04ngwr7awtCkx7sSNkK4= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107022] error: use of deleted function 'std::unordered_map Date: Fri, 23 Sep 2022 22:22:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107022 --- Comment #6 from Andrew Pinski --- (In reply to piersh from comment #4) > struct my_hash > { > my_hash() {} > my_hash(int i =3D 42) {} // <<-- uncomment for bug > std::size_t operator()(const key &ep) const { return 0; } > }; That is because my_hash constructor call with no arguments is ambigous at t= hat point. If you define one or the other constructor, it is no longer ambigous= . If you define both, the code is invalid.=