From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 357D23858C2C; Sun, 27 Mar 2022 19:21:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 357D23858C2C From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102419] [11/12 Regression][concepts] return-type-requirement of "Y" does not check that T::type actually exists Date: Sun, 27 Mar 2022 19:21:27 +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.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc short_desc 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: Sun, 27 Mar 2022 19:21:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102419 Jason Merrill changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org Summary|[11/12 |[11/12 |Regression][concepts] |Regression][concepts] |[regression] |return-type-requirement of |return-type-requirement of |"Y" does |"Y" does |not check that T::type |not check that T::type |actually exists |actually exists | --- Comment #6 from Jason Merrill --- Concept satisfaction was very deliberately designed in committee discussion= to work differently from void_t, based on the normalized form rather than the concept-id as written. So this example is well-formed: template concept is_void =3D same_as(Tz, void); template concept void_or_same =3D is_void || same_= as; template void f() requires void_or_same; int main() { f(); } // OK It definitely is an inconsistency with non-concept template-ids, but that's= the design. C++20 national body comment CA104 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2103r0.html#CA104= ) is about one situation where we do need to substitute directly into the argume= nts, but it is a single exception to the rule. In the discussion of CA104 I suggested that we might want to reconsider this design (on 2019-11-08, if you want to look up the reflector message), and m= ake my example above ill-formed, but we ended up making an exception instead. The behavior change you are seeing is from properly implementing http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1452r2.html and no= t a bug.=