From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 193D538582A0; Mon, 24 Oct 2022 16:55:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 193D538582A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666630538; bh=OhVCFVHJFcwakkLRm9H4oWuS9R5xVxjfnKskwuyZhVE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E/6HARQWpF5/f8ZT1Z4TbajNHJZDYa/7y9FXd8nR6qOvxuEzORzh74/NoiV299+cL EzP1l4SdTUxlOmkZjTGyFaVmh91l4VL3QJNFAdYUNEJv20zCcYJ+rq0vqOFEiI5tky /NJrRUFgIoYsDQ58Nxp/mu3B0jAYA+MhRiYXB6J0= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107378] `get_if` implementation "is not a constant expression" Date: Mon, 24 Oct 2022 16:55:37 +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: 13.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D107378 --- Comment #2 from Andrew Pinski --- Reduced testcase without any headers: ``` struct g { char a; }; constexpr bool f(const char *a) { return a !=3D nullptr; } static_assert([v =3D g{}] { return f(&v.a); }()); ``` This works with clang. But MSVC rejects it ...=