On Tue, Aug 12, 2014 at 11:34:35AM +0200, Jakub Jelinek wrote: > On Tue, Aug 12, 2014 at 05:25:25PM +0800, Thomas Preud'homme wrote: > > --- a/gcc/c/c-parser.c > > +++ b/gcc/c/c-parser.c > > @@ -486,6 +486,15 @@ c_token_starts_typename (c_token *token) > > case CPP_KEYWORD: > > switch (token->keyword) > > { > > + case RID_FLOAT: > > + case RID_DOUBLE: > > + case RID_DFLOAT32: > > + case RID_DFLOAT64: > > + case RID_DFLOAT128: > > + if (flag_no_float) > > + error_at (token->location, "use of floating points forbidden in " > > + "this translation unit (-fno-float)"); > > + /* Fall through. */ > > case RID_UNSIGNED: > > case RID_LONG: > > case RID_INT128: > > This looks wrong. c_token_starts_typename is just a function which tells > you if certain token can start a typename, issuing diagnostics there doesn't > make sense, that routine doesn't actually parse the token. You should > diagnose it where you actually parse it.
I'd say the proper place would be declspecs_add_type. Marek