From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B05173951C78; Tue, 23 Jun 2020 15:36:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B05173951C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592926595; bh=PtmU9RlvzGjzt/VbPPyoV6E45WqmOHNK1oPpeffrxCI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L0881wUrV43k4NLDzMENKAVdzCSDuLfgRq83D9NbfoRwnf4w7JgWTTEb+EDtCyPR9 xYsReU0Vk6rgBXekvlHPVPXjspVj3x027Zta6RMsCqSP1B2N/KSvAQ+cMQlo3EKeJ3 9qgDn85xF3DwIAuAZ2KM8WtYaj2VjC5yacRpTXCo= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/95832] std::vector specialization leading std::variant ctor treating it as int rather than bool Date: Tue, 23 Jun 2020 15:36:35 +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: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 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, 23 Jun 2020 15:36:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95832 --- Comment #8 from Jonathan Wakely --- No, that doesn't work for things convertible to pointers. #include struct P { operator void*() const; }; std::variant v{ P{} }; The argument type here is not a pointer, so your suggestion would construct= the bool, which is exactly the case P0602 was designed to prevent. "Can be converted to bool via conversion to a pointer or function pointer t= ype" is not practical to detect, and I have no intention of trying. See Bug 93628 for a related problem.=