From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5ADF53858D3C; Mon, 28 Nov 2022 09:28:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5ADF53858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669627701; bh=qSpWFKys/E55ztwlQVX+zUpZfXfMRjjx7MEgovyjOJs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KBQ1ptCeAzS5CjNMrPx61pdG3iILFdkOCpjXvl6oT9dl1oab6D9RAr3i7ZMwPbMIO wMlKptq2VBhN1NbtahUBwgNgEUri6M1C4lEqhMkwEcMdjJ4jULoYLYDf0/CKK9m9Qd QbX6ShUWXdjSbVPbLXNzHh4H7TkC490vtpah6/tQ= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107889] Incorrect parsing of qualified friend function returning decltype(auto) Date: Mon, 28 Nov 2022 09:28:21 +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.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi 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=3D107889 --- Comment #3 from Jonathan Wakely --- (In reply to David Mazi=C3=A8res from comment #0) > A similar problem was reported in bug #59766 for friend functions returni= ng > auto. That's unrelated. The problem here is that decltype(auto)::f is a nested-name-specifier for a member 'f' so is parsed as part of the return type, not the function name. = This is what C++20 (and all earlier standards) said. The ambiguity has been reso= lved as a DR against earlier standards, but GCC doesn't implement that change ye= t, as shown at https://gcc.gnu.org/projects/cxx-status.html#cxx23=