On 11/30/2017 04:18 AM, Jakub Jelinek wrote:
Here is an incremental patch to deal with that on top of the previously
posted patch, ok for trunk if it passes testing? Note, not using inform_n
in this !tree_fits_uhwi_p case, because gettext doesn't recommend that for
negative values and the other values printed there (the very large ones) are
printed using hexadecimal where also I think human plural forms are rarely
useful.
2017-11-30 Jakub Jelinek <ja...@redhat.com>
* decl.c (cp_finish_decomp): Split up count != eltscnt and
!tree_fits_uhwi_p (tsize) error_at calls into error_n and inform_n
to handle plural forms properly.
* g++.dg/cpp1z/decomp3.C: Adjust for structured binding count
mismatch diagnostics split into error and warning with plural
forms.
* g++.dg/cpp1z/decomp10.C: Likewise.
* g++.dg/cpp1z/decomp32.C: Likewise.
Ok.
--- gcc/cp/decl.c.jj 2017-11-30 09:44:19.000000000 +0100
+++ gcc/cp/decl.c 2017-11-30 09:57:44.539504854 +0100
@@ -7445,11 +7445,18 @@ cp_finish_decomp (tree decl, tree first,
+ inform_n (loc, eltscnt != (unsigned long) eltscnt
+ ? (eltscnt % 1000000) + 1000000 : eltscnt,
Is such elaboration with the modulo operator necessary? wouldn;t an
arbitrary non-unity constant do. (It took me a while to figure out what
this was trying to do. At least a comment?)
nathan
--
Nathan Sidwell