public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Volker Reichelt <reichelt@igpm.rwth-aachen.de> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/4707: g++ complains about a "typedef", but no typedefs are there Date: Wed, 04 Dec 2002 02:26:00 -0000 [thread overview] Message-ID: <20021204102604.23657.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/4707; it has been noted by GNATS. From: Volker Reichelt <reichelt@igpm.rwth-aachen.de> To: gcc-gnats@gcc.gnu.org, dlux@dlux.dlux.hu, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/4707: g++ complains about a "typedef", but no typedefs are there Date: Wed, 4 Dec 2002 12:12:14 +0100 The problem can be demonstrated with the following (illegal) code snippet: --------------------------snip here----------------------------- template <class T> struct A { void foo() { bar(T); } void bar(); } typedef int INT; --------------------------snip here----------------------------- With mainline I get the following error message: PR4707.cc: In member function `void A<T>::foo()': PR4707.cc:3: error: parse error before `typedef' PR4707.cc: At global scope: PR4707.cc:7: error: extraneous `int' ignored PR4707.cc:7: error: template declaration of `typedef struct A<T> INT' There are two things correct about the error message: * The bug is in the member function `void A<T>::foo()'. * It is in line 3 (you cannot use the template parameter T like this). The rest is bogus: * The parse error happens before ")" and not before the "typedef" which comes after the end of the whole struct. You can actually place as many members between "foo" and the end of the struct as you want - the parser complains about the typedef. * The last three lines of the error message are nonsense. Hopefully, this gets fixed with the new parser. Regards, Volker http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4707
next reply other threads:[~2002-12-04 10:26 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-12-04 2:26 Volker Reichelt [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-12-04 6:26 Wolfgang Bangerth 2001-10-27 4:46 lerdsuwa
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=20021204102604.23657.qmail@sources.redhat.com \ --to=reichelt@igpm.rwth-aachen.de \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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).