-
Bug
-
Resolution: Unresolved
-
Undefined
-
rhel-9.7
-
None
-
Yes
-
Low
-
rhel-pt-gcc-1
-
1
-
False
-
False
-
-
No
-
None
-
None
-
None
-
Unspecified Release Note Type - Unknown
-
Unspecified
-
Unspecified
-
Unspecified
-
None
The following code can no longer be compiled properly with gcc-15 and -O3:
# cat test.cpp #include <sstream> #include <string> #include <print> #include <chrono> int main() { std::istringstream iss("Jun 22"); std::chrono::year_month ym; iss >> std::chrono::parse("%b%t%y", ym); std::print("{} {}", iss.fail(), ym); return 0; }
Compiling it thus and running it yields the wrong output:
[root@r810 ~]# /opt/rh/gcc-toolset-15/root/usr/bin/g++ test.cpp -o test -std=c++26 -O3
[root@r810 ~]# ./test
true 0000/0 is not a valid month
This used to work fine with gcc-toolset-14:
[root@r810 ~]# /opt/rh/gcc-toolset-14/root/usr/bin/g++ test.cpp -o test -std=c++26 -O3
[root@r810 ~]# ./test
false 2022/Jun
It also works fine with -O0:
[root@r810 ~]# /opt/rh/gcc-toolset-15/root/usr/bin/g++ test.cpp -o test -std=c++26 -O0
[root@r810 ~]# ./test
false 2022/Jun
- is duplicated by
-
RHEL-152365 std::get_time fails with %b format with -O2 enabled (From -fipa_sra)
-
- Closed
-