From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1737D3858405; Tue, 21 Sep 2021 17:48:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1737D3858405 From: "ppalka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94673] [concepts] What is the return type of local parameters of requires expressions? Date: Tue, 21 Sep 2021 17:48:45 +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: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppalka 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: cc 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, 21 Sep 2021 17:48:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94673 Patrick Palka changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ppalka at gcc dot gnu.org --- Comment #4 from Patrick Palka --- (In reply to gcc-bugs from comment #3) > I think this bug should be changed to a request to improve the diagnostic= s. >=20 > The diagnostic says: >=20 > ``` > :13:15: note: constraints not satisfied > :8:9: required by the constraints of 'template concept > foo' > :8:15: in requirements with 't v' [with t =3D int] > :10:6: note: 'v' does not satisfy return-type-requirement > 10 | {v} -> same_as; > | ^ > ``` >=20 > If you don't know that `{v}` should be read as `{(v)}`, it is confusing t= hat > the diagnostic says that `'t v' [with t =3D int]` does not satisfy that t= he > type of the expression `{ v }` is `t`. >=20 > I think the diagnostic for the return-type-requirement should add the rea= son > / diagnostic why it isn't fulfilled, so basically the same reason that > `static_assert(std::same_as);` would give. >=20 > > note: the expression 'is_same_v<_Tp, _Up> [with _Tp =3D int&; _Up =3D i= nt]' evaluated to 'false' > > 57 | concept __same_as =3D std::is_same_v<_Tp, _Up>; > > | ~~~~~^~~~~~~~~~~~~~~~~~~ Don't we already do this with -fconcepts-diagnostics-depth=3D2 ?=