diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-08-24 16:17:04 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-08-24 16:17:04 +0100 |
commit | a0e6f05d26d286f5a73007e425b109f0d327e15f (patch) | |
tree | 5c8365724b55a1260eafcfc34f8905134cf4a57e /gcc/fold-const.c | |
parent | 074436cf8cdd2a9ce75cadd36deb8301f00e55b9 (diff) | |
download | gcc-a0e6f05d26d286f5a73007e425b109f0d327e15f.zip gcc-a0e6f05d26d286f5a73007e425b109f0d327e15f.tar.gz gcc-a0e6f05d26d286f5a73007e425b109f0d327e15f.tar.bz2 |
libstdc++: Fix iota_view::size() to avoid overflow
This avoids the overflow that occurs when negating the most negative
value of an integral type.
Also prevent returning signed int when the values have lower rank and
promote to int.
libstdc++-v3/ChangeLog:
* include/std/ranges (ranges::iota_view::size()): Perform all
calculations in the right unsigned types.
* testsuite/std/ranges/iota/size.cc: New test.
Diffstat (limited to 'gcc/fold-const.c')
0 files changed, 0 insertions, 0 deletions