From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D5F33855015; Fri, 11 Jun 2021 16:58:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D5F33855015 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBjKysvOTcyMDJdIEdDQyByZXBvcnRzIGFuIGVycm9yOiBl?= =?UTF-8?B?eHBlY3RlZCB1bnF1YWxpZmllZC1pZCBiZWZvcmUg4oCYc2hvcnTigJk=?= Date: Fri, 11 Jun 2021 16:58: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: 11.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek 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 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: Fri, 11 Jun 2021 16:58:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97202 --- Comment #6 from Jonathan Wakely --- If the invalid special member is defined out of the class body, you get ano= ther error: template struct F { F(); }; template inline F::F() { } 101032.C:4:8: error: expected unqualified-id before =E2=80=98)=E2=80=99 tok= en 4 | F(); | ^ 101032.C:8:8: error: no declaration matches =E2=80=98F::F()=E2=80=99 8 | inline F::F() { } | ^~~~ 101032.C:8:8: note: no functions named =E2=80=98F::F()=E2=80=99 101032.C:2:8: note: =E2=80=98struct F=E2=80=99 defined here 2 | struct F | ^ As well as improving the first error (which is the subject of this bug) may= be the constructor could be parsed as though it had been written correctly, so that the "no declaration matches" error doesn't happen. Compilation is alre= ady going to fail, we don't need to also complain about the valid function definition not matching anything.=