Re: [PATCH] PR preprocessor/7263 - Avoid pedantic warnings on system headers macro tokens
OK. Jason
Re: [PATCH] PR preprocessor/7263 - Avoid pedantic warnings on system headers macro tokens
On 05/10/2012 01:53 PM, Dodji Seketeli wrote: + if (found_decl_spec ds != ds_last) Do we still need found_decl_spec? + if (decl_spec_seq_has_spec_p (decl_specifiers, ds_inline)) permerror (input_location, explicit instantiation shall not use %inline% specifier); - if (decl_specifiers.specs[(int)ds_constexpr]) + if (decl_spec_seq_has_spec_p (decl_specifiers, ds_constexpr)) permerror (input_location, explicit instantiation shall not use These can use the specifier locations, right? Jason
Re: [PATCH] PR preprocessor/7263 - Avoid pedantic warnings on system headers macro tokens
It seems like for most of the declspecs, having both the location and a flag/count is unnecessary; instead of checking the flag, we can check whether the location is set. That won't work for the long long long check, but it should work for the others. You'll need to change _check_decl_spec to take the new declspec and location rather than have it iterate every time, but that seems worth doing anyway. So I don't think we need both cp_decl_spec and cp_decl_spec_word. error_at (location, %__thread% before %qD, ridpointers[keyword]); decl_specs-specs[(int) ds_thread] = 0; + decl_specs-locations[cpdw_thread] = location; This error should use the stored __thread location, and then set it to 0 rather than the location argument. + decl_specs-locations[cpdw_builtin_type_spec] = location; if (!decl_specs-type) { decl_specs-type = type_spec; decl_specs-type_definition_p = false; - decl_specs-type_location = location; + decl_specs-locations[cpdw_type_spec] = location; Why do we need cpdw_builtin_type_spec? Jason
Re: [PATCH] PR preprocessor/7263 - Avoid pedantic warnings on system headers macro tokens
Jason Merrill ja...@redhat.com writes: + decl_specs-locations[cpdw_builtin_type_spec] = location; if (!decl_specs-type) { decl_specs-type = type_spec; decl_specs-type_definition_p = false; - decl_specs-type_location = location; + decl_specs-locations[cpdw_type_spec] = location; Why do we need cpdw_builtin_type_spec? To unify the way we access locations for the specifiers. Otherwise, it looks awkward to have a lone decl_specs-type_location for the type specifier, whereas the other specifiers have their locations in decl_specs-locations. But if you don't like that, I'll just revert it. -- Dodji
Re: [PATCH] PR preprocessor/7263 - Avoid pedantic warnings on system headers macro tokens
On 05/04/2012 12:32 PM, Dodji Seketeli wrote: Jason Merrillja...@redhat.com writes: + decl_specs-locations[cpdw_builtin_type_spec] = location; if (!decl_specs-type) { decl_specs-type = type_spec; decl_specs-type_definition_p = false; - decl_specs-type_location = location; + decl_specs-locations[cpdw_type_spec] = location; Why do we need cpdw_builtin_type_spec? To unify the way we access locations for the specifiers. Otherwise, it looks awkward to have a lone decl_specs-type_location for the type specifier, whereas the other specifiers have their locations in decl_specs-locations. But if you don't like that, I'll just revert it. No, I agree that cpdw_type_spec makes sense. I just don't see why we need the _builtin_ variant. Jason