This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix a C++ parser error message (PR c++/9851)



That's arguably a little bit too late, though, since we will have
already issued this error:
   foo.cc:6: error: `do_nothing' has not been declared
That error is issued by the call to cp_parser_type_name().



That doesn't bother me. I think that's an OK message.

One can spend forever optimizing error messages, but the most important thing is not to be totally stupid. I'd say that if we just issued that error message and nothing else, we'd be doing fine. If we also issued a follow-on message that said "perhaps you should have used -> instead of ." we'd be doing great.

I don't yet see a good way to avoid the error message without doing a
tentative parse.


Tentative parsing is expensive so we want to avoid it where we can.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]