public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/99301] New: [11 Regression]: cast conversions in chrono require uint32_t to be unsigned int
@ 2021-02-27 11:33 hp at gcc dot gnu.org
2021-02-27 11:34 ` [Bug libstdc++/99301] " hp at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: hp at gcc dot gnu.org @ 2021-02-27 11:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99301
Bug ID: 99301
Summary: [11 Regression]: cast conversions in chrono require
uint32_t to be unsigned int
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: hp at gcc dot gnu.org
CC: redi at gcc dot gnu.org
Target Milestone: ---
Host: x86_64-linux
Target: cris-elf
Since 97d6161f6a7fa712 / r11-7370 "libstdc++: More efficient
days from date" I see an additional 81 testsuite-errors for
cris-elf, with this in g++.log for one randomly picked
regressing test:
FAIL: g++.dg/cpp1y/pr57640.C -std=c++2a (test for excess errors)
Excess errors:
/x/gccobj/cris-elf/libstdc++-v3/include/chrono:2483:25: error: invalid
'static_cast' from type 'const std::chrono::month' to type 'uint32_t' {aka
'long unsigned int'}
/x/gccobj/cris-elf/libstdc++-v3/include/chrono:2484:25: error: invalid
'static_cast' from type 'const std::chrono::day' to type 'uint32_t' {aka 'long
unsigned int'}
/x/gccobj/cris-elf/libstdc++-v3/include/chrono:2496:69: error: no matching
function for call to 'std::chrono::duration<long long int, std::ratio<86400>
>::duration(<brace-enclosed initializer list>)'
The commit shows conversions to uint32_t, which for
e.g. x86_64-linux is "unsigned int", and there are explicit
conversions to unsigned int for month and day (see patch
context).
But, "newlib ILP32 targets" have an uint32_t that is
effectively typedef'd "long unsigned int" (see
newlib-stdint.h UINT32_TYPE).
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/99301] [11 Regression]: cast conversions in chrono require uint32_t to be unsigned int
2021-02-27 11:33 [Bug libstdc++/99301] New: [11 Regression]: cast conversions in chrono require uint32_t to be unsigned int hp at gcc dot gnu.org
@ 2021-02-27 11:34 ` hp at gcc dot gnu.org
2021-02-27 12:53 ` cvs-commit at gcc dot gnu.org
2021-02-27 12:56 ` redi at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: hp at gcc dot gnu.org @ 2021-02-27 11:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99301
Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2021-02-27
Status|UNCONFIRMED |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |hp at gcc dot gnu.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/99301] [11 Regression]: cast conversions in chrono require uint32_t to be unsigned int
2021-02-27 11:33 [Bug libstdc++/99301] New: [11 Regression]: cast conversions in chrono require uint32_t to be unsigned int hp at gcc dot gnu.org
2021-02-27 11:34 ` [Bug libstdc++/99301] " hp at gcc dot gnu.org
@ 2021-02-27 12:53 ` cvs-commit at gcc dot gnu.org
2021-02-27 12:56 ` redi at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-27 12:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99301
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:699672d4dccfb5579dbe48977bda86f6836225a0
commit r11-7427-g699672d4dccfb5579dbe48977bda86f6836225a0
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Sat Feb 27 12:50:53 2021 +0000
libstdc++: Fix conversions from date types to integers [PR 99301]
The conversions to integer types are explicit, so need to use the
correct type. Converting to uint32_t only works if that is the same type
as unsigned.
libstdc++-v3/ChangeLog:
PR libstdc++/99301
* include/std/chrono (year_month_day::_M_days_since_epoch()):
Convert chrono::month and chrono::day to unsigned before
converting to uint32_t.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/99301] [11 Regression]: cast conversions in chrono require uint32_t to be unsigned int
2021-02-27 11:33 [Bug libstdc++/99301] New: [11 Regression]: cast conversions in chrono require uint32_t to be unsigned int hp at gcc dot gnu.org
2021-02-27 11:34 ` [Bug libstdc++/99301] " hp at gcc dot gnu.org
2021-02-27 12:53 ` cvs-commit at gcc dot gnu.org
@ 2021-02-27 12:56 ` redi at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2021-02-27 12:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99301
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.0
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Sorry about that, I did consider the case where uint32_t was unsigned long, but
only in the context of the arithmetic in that function. I forgot the explicit
conversion operators wouldn't work.
It should be fixed now.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-27 12:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-27 11:33 [Bug libstdc++/99301] New: [11 Regression]: cast conversions in chrono require uint32_t to be unsigned int hp at gcc dot gnu.org
2021-02-27 11:34 ` [Bug libstdc++/99301] " hp at gcc dot gnu.org
2021-02-27 12:53 ` cvs-commit at gcc dot gnu.org
2021-02-27 12:56 ` redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).