This is the mail archive of the 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: [PATCH,c++] provide intelligent error messages for missing semicolon after class definition

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.


> +      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
(650) 331-3385 x713

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