public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/10618] Error message for function declarations with invalid return type could be improved Date: Wed, 21 Sep 2011 15:39:00 -0000 [thread overview] Message-ID: <bug-10618-4-lXCdOywFkV@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-10618-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10618 --- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-09-21 15:30:26 UTC --- > > > test.cc:12:1: error: need ‘typename’ before ‘A<T>::k’ because ‘A<T>’ is a > > dependent scope > > test.cc:14:6: error: expected constructor, destructor, or type conversion > > before ‘func2’ > > > Clang gives the correct output: > > > > /tmp/webcompile/_10395_0.cc:12:1: error: missing 'typename' prior to dependent > > type name 'A<T>::k' > > A<T>::k func1(); > > ^~~~~~~ > > typename > > /tmp/webcompile/_10395_0.cc:14:4: error: no type named 'k' in 'B' > > B::k func2(); > > ~~~^ > > 2 errors generated. > > Huh? This is the same as G++'s output > The second diagnostic from G++ does not make sense. Clang gives the correct diagnostics in that case. > If you instantiate the function template G++ trunk gives a better diagnostic > than clang 3.0 Great! Let's say this is almost fixed then.
next prev parent reply other threads:[~2011-09-21 15:30 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-10618-4@http.gcc.gnu.org/bugzilla/> 2011-09-21 14:56 ` manu at gcc dot gnu.org 2011-09-21 15:03 ` redi at gcc dot gnu.org 2011-09-21 15:39 ` manu at gcc dot gnu.org [this message] 2011-09-21 15:48 ` redi at gcc dot gnu.org 2011-09-21 16:00 ` manu at gcc dot gnu.org 2011-09-21 16:09 ` manu at gcc dot gnu.org [not found] <20030504101600.10618.giovannibajo@libero.it> 2003-08-04 0:39 ` pinskia at physics dot uc dot edu 2004-02-26 12:55 ` giovannibajo at libero dot it 2004-04-28 2:17 ` pinskia at gcc dot gnu dot org 2004-08-16 10:56 ` giovannibajo at libero dot it
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-10618-4-lXCdOywFkV@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).