This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: c++ diagnostics
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Chris Lattner <clattner at apple dot com>
- Cc: Benjamin Kosnik <bkoz at redhat dot com>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 6 Apr 2010 09:20:28 -0700
- Subject: Re: RFC: c++ diagnostics
- References: <20100405082033.7a9bcf81@redhat.com> <4758A2DF-1B47-4838-A1DE-F755B29DC0F3@apple.com>
On Tue, Apr 06, 2010 at 09:00:16AM -0700, Chris Lattner wrote:
> I wrote a little blog post that shows off some of the things that Clang can do. It would be great to improve some of GCC/G++'s diagnostics in a similar way:
>
> http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html
Some of Chris's examples appear to be regressions, in that gcc's old
bison-based parser did a better job than the current parser. In
particular, around the time of the 2->3 transition, a rule was added to
catch the fact that
foo bar;
where neither is defined as a type, almost certainly is because of a
missing definition of the type foo, or a mis-spelling (this is what is
going on in several of Chris's examples). I pushed to get that rule
added because I tried a lot of "C++" code that had only been compiled
with g++ 2.9x, and it was filled with uses of STL without std:: because
back then, the standard library wasn't in a namespace and std:: was
magic that was ignored.