public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97202] GCC reports an error: expected unqualified-id before ‘short’ Date: Fri, 11 Jun 2021 16:58:21 +0000 [thread overview] Message-ID: <bug-97202-4-99qzBv7lzY@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-97202-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97202 --- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- If the invalid special member is defined out of the class body, you get another error: template<typename T> struct F { F<T>(); }; template<typename T> inline F<T>::F() { } 101032.C:4:8: error: expected unqualified-id before ‘)’ token 4 | F<T>(); | ^ 101032.C:8:8: error: no declaration matches ‘F<T>::F()’ 8 | inline F<T>::F() { } | ^~~~ 101032.C:8:8: note: no functions named ‘F<T>::F()’ 101032.C:2:8: note: ‘struct F<T>’ defined here 2 | struct F | ^ As well as improving the first error (which is the subject of this bug) maybe the constructor could be parsed as though it had been written correctly, so that the "no declaration matches" error doesn't happen. Compilation is already going to fail, we don't need to also complain about the valid function definition not matching anything.
next prev parent reply other threads:[~2021-06-11 16:58 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-09-25 8:05 [Bug c++/97202] New: " tangyixuan at mail dot dlut.edu.cn 2020-09-25 8:27 ` [Bug c++/97202] [11 Regression] " rguenth at gcc dot gnu.org 2020-09-25 8:40 ` pinskia at gcc dot gnu.org 2020-09-25 13:16 ` mpolacek at gcc dot gnu.org 2020-09-25 13:20 ` [Bug c++/97202] " mpolacek at gcc dot gnu.org 2020-09-25 13:21 ` mpolacek at gcc dot gnu.org 2021-06-09 17:12 ` mpolacek at gcc dot gnu.org 2021-06-11 16:54 ` redi at gcc dot gnu.org 2021-06-11 16:58 ` redi at gcc dot gnu.org [this message] 2022-02-08 10:15 ` redi at gcc dot gnu.org 2022-02-08 10:17 ` redi at gcc dot gnu.org 2024-02-10 13:38 ` cvs-commit at gcc dot gnu.org 2024-02-10 13:43 ` mpolacek at gcc dot gnu.org 2024-04-21 21:38 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-97202-4-99qzBv7lzY@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).