From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E07DB3858C52; Thu, 28 Sep 2023 17:11:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E07DB3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695921088; bh=D15g0XMunwD7QRkEZRmi2x8084o+BXWgRrHah0TnniY=; h=From:To:Subject:Date:From; b=OLvWFSKz+H9RNvrbxwKxAGalKKRoTdaTU+/4kYqBUq+omsWirqUcvWTAj5F6+8f1H cNt+5ZMROmHUerSSD6GGcqUuHlXcA2qMmfN8Nu/c8U9xl4IN73GwLrFZWFYl1uePjp P3CfnB5G7lhIyn+DwqWv3OdS2mf9Z5pLZ0oHKDfE= From: "richard-gccbugzilla at metafoo dot co.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111633] New: __restrict on a member function is permitted in an inconsistent location relative to ref-qualifiers Date: Thu, 28 Sep 2023 17:11:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: richard-gccbugzilla at metafoo dot co.uk 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D111633 Bug ID: 111633 Summary: __restrict on a member function is permitted in an inconsistent location relative to ref-qualifiers Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: richard-gccbugzilla at metafoo dot co.uk Target Milestone: --- GCC permits __restrict-qualified member functions. When combined with ref-qualifiers, the __restrict is written with the cv-qualifiers instead of after the ref-qualifier: struct A { // accepted void f() const __restrict &; // rejected void f() const & __restrict; }; This seems backwards to me. The `*this` parameter is of type `const &__rest= rict self`, so the latter syntax seems more appropriate. Perhaps it would make sense to accept the latter syntax, and possibly depre= cate the former? (In the case of no ref-qualifier, it might make sense to also deprecate the case where the restrict qualifier is before or interleaved wi= th cv-qualifiers.)=