This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH,c++] provide intelligent error messages for missing semicolon after class definition
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Nathan Froyd <froydnj at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Date: Tue, 16 Nov 2010 18:39:20 -0800
- Subject: Re: [PATCH,c++] provide intelligent error messages for missing semicolon after class definition
- References: <20101109133016.GA7991@nightcrawler>
On 11/9/2010 5:30 AM, Nathan Froyd wrote:
> The patch below addresses PR c++/45331 (and related PRs) by providing a
> more helpful error message (in some cases) when the user forgets a
> semicolon at the end of a class definition.
Nice.
> + case CPP_NAME:
> + case CPP_SEMICOLON:
> + case CPP_MULT:
> + case CPP_AND:
> + case CPP_OPEN_PAREN:
> + case CPP_CLOSE_PAREN:
> + case CPP_COMMA:
> + want_semicolon = false;
> + break;
> + /* While it's legal for type qualifiers and storage class
Usual GNU style is a blank line after the "break", especially before a
big comment. Also, I'm a little worried that we'll add something
somewhere and forget to update this list, or the list of
> + case RID_CONST:
> + case RID_VOLATILE:
specifiers and types (RID_INT, etc). Would you please factor into a
predicate function? I guess the best possible thing would be a .def
file or other table where when adding new RID_* things you'd be forced
to fill in the appropriate blanks here, but maybe that's insane effort?
Thank you,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713