From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D0D1A385B53D; Tue, 7 Mar 2023 02:18:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0D1A385B53D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678155496; bh=cQwb8Oi4NRRbhoJD7VXIhB4q0Te5If6mifUIkQLMmTQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UTwIZkE0Bki3ed1NamVY67+HNNO0yWvOopUnR0t623GHVoJlsVXhEGgPRo0slVxfd T3+BYawcyoMwg0uSbiddJQfk/4POip4fxfRvRj0FpMalLJ+PRsb3a8hYfxV9lucjhl VboyoI55NcKHo6zUlpGDQ5lSG19SdehsEwbXVRqI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107179] [11/12 Regression] requires-expression gives hard error for inaccessible constructor Date: Tue, 07 Mar 2023 02:18:15 +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: 12.2.1 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: P2 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 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=3D107179 --- Comment #3 from CVS Commits --- The releases/gcc-12 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:668098c2e55c33f97e331c3160174bf12c3d88f7 commit r12-9227-g668098c2e55c33f97e331c3160174bf12c3d88f7 Author: Patrick Palka Date: Thu Nov 3 15:35:18 2022 -0400 c++: requires-expr and access checking [PR107179] Like during satisfaction, we also need to avoid deferring access checks during substitution of a requires-expr because the outcome of an access check can determine the value of the requires-expr. Otherwise (in deferred access checking contexts such as within a base-clause), the requires-expr may evaluate to the wrong result, and along the way a failed access check may leak out from it into a non-SFINAE context and cause a hard error (as in the below testcase). PR c++/107179 gcc/cp/ChangeLog: * constraint.cc (tsubst_requires_expr): Make sure we're not deferring access checks. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-requires31.C: New test. (cherry picked from commit 40c34beef620ed13c4113c893ed4335ccc1b8f92)=