On 6/6/19 9:00 AM, Paolo Carlini wrote:
Hi,

only minor functional changes here - more precise locations for two error messages  - but I think it's a step in the right direction: it moves the declaration of id_loc way up, near typespec_loc and as such id_loc is immediately used. Then its value is updated upon the loop over declarator in the middle of the function and used again in the final part of the function. That also "frees" the simple name loc for other local uses, allows to simplify those checks changed rather recently over (name && declarator). and (unqualified_id && declarator). Tested x86_64-linux.

Mostly OK, except:

   if (declspecs->multiple_types_p)
     {
-      error ("two or more data types in declaration of %qs", name);
+      error_at (id_loc, "two or more data types in declaration of %qs", name);
       return error_mark_node;
     }

declspecs->locations[ds_type_spec]?

   if (declspecs->conflicting_specifiers_p)
     {
-      error ("conflicting specifiers in declaration of %qs", name);
+      error_at (id_loc, "conflicting specifiers in declaration of %qs", name);
       return error_mark_node;
     }

ds_storage_class/ds_typedef?

Jason

Reply via email to