c++: Fix thinko in enum_min_precision [PR61414]
commit53073523bca574251d45bded65b2b0c183b01e5d
authorJakub Jelinek <jakub@redhat.com>
Fri, 14 Feb 2020 16:36:00 +0000 (14 17:36 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 14 Feb 2020 16:43:12 +0000 (14 17:43 +0100)
tree5f8bdb4af105b188cf6d3df28341bbe6469c212b
parentcd73697811f4d638a26be9aeada6eb20b645b739
c++: Fix thinko in enum_min_precision [PR61414]

When backporting the PR61414 fix to 8.4, I've noticed that the caching
of prec is actually broken, as it would fail to actually store the computed
precision into the hash_map's value and so next time we'd think the enum needs
0 bits.

2020-02-14  Jakub Jelinek  <jakub@redhat.com>

PR c++/61414
* class.c (enum_min_precision): Change prec type from int to int &.

* g++.dg/cpp0x/enum39.C: New test.
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/enum39.C [new file with mode: 0644]