From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 387563858C00; Sat, 8 Jul 2023 07:22:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 387563858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688800959; bh=VlWcxNDy4+ZY/2pcFFcYWcxCUd72/aX6Isy5yRgC6aU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=w4EOE3xKtkUK9Ij4zrrehVwfl6EbQ1g4XcJvMcFKrWTHXPidNpiBrEa5fh16bFeUj G8O7mtiYhoEqmwLPK0+3uBUOQzdRgIYxpUEzX4mUHeK7w7hFe3BBIJm1pJ/6HUInQT 1jiadjjvEaG/YdUT/j9nI6vZpq6DaTWKZus1b9YI= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/110594] std::variant's converting constructor does not resolve alternative correctly Date: Sat, 08 Jul 2023 07:22:38 +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: 13.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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=3D110594 --- Comment #1 from Jonathan Wakely --- converting a size_t to int64_t is a narrowing conversion, try it without a constant value and you'll get an error: https://godbolt.org/z/rb6jrr4xq That's what the SFINAE check for _Arr does, so your {size_t(1)} is not equivalent and your assumptions based on that are incorrect.=