Hi,

On 12/10/19 00:28, Jakub Jelinek wrote:
@@ -10036,8 +10035,6 @@ compute_array_index_type_loc (location_t name_loc,
               indicated by the state of complain), so that
               another substitution can be found.  */
            return error_mark_node;
-         else if (in_system_header_at (input_location))
-           /* Allow them in system headers because glibc uses them.  */;
          else if (name)
            pedwarn (loc, OPT_Wpedantic,
                     "ISO C++ forbids zero-size array %qD", name);
But this one is unclear, in_system_header_at is testing a different location
from what will be used by pedwarn, so if input_location is in system header
and loc is not, it didn't pedwarn before and now it will.
Similarly various other spots in the patch.  I haven't tried to check in
detail what exactly we want in each case, all I want to say is that some
cases are obvious, other cases are not.

Thanks for noticiing. We already discussed that a bit with Marek: we believe it should not make a difference, in practice, because the difference should only be quite small and if the first location is in the header the second one is supposed to be there too. More importantly, as far as I know, the difference is just an historical artifact and many actually I created myself ;) when I started changing decl.c, decl2.c, etc, to pass locations more consistently: I simply left the in_system_header bits alone for simplicity (as discussed with Marek).

Thanks, Paolo.

Reply via email to