[Bug libstdc++/119141] ub sanitizer incorrect overflow detection

2025-03-07 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119141 --- Comment #9 from Jonathan Wakely --- No, that's absolutely not what it means. The original author of that wording and the reference implementation of chrono is quoted saying what it means at https://cplusplus.github.io/LWG/issue3090 "This r

[Bug libstdc++/119141] ub sanitizer incorrect overflow detection

2025-03-07 Thread kelbonage at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119141 --- Comment #8 from Nikl Kelbon --- I saw example, yes, its unclear what standard means here. May be this lines was written with something interesting in mind, such as 'duration is not just integer under templates', instead may be some overflow

[Bug libstdc++/119141] ub sanitizer incorrect overflow detection

2025-03-07 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119141 --- Comment #7 from Jonathan Wakely --- And the note you quoted is about "implicit truncation" to a lower resolution duration i.e. preventing milliseconds being implicitly converted to seconds, which would lose precision. It has nothing to do w

[Bug libstdc++/119141] ub sanitizer incorrect overflow detection

2025-03-07 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119141 --- Comment #6 from Jonathan Wakely --- There's an open issue about that wording, because it's not clear what it's supposed to mean: https://cplusplus.github.io/LWG/issue3090 It's impossible to constrain the constructor so that it won't compile

[Bug libstdc++/119141] ub sanitizer incorrect overflow detection

2025-03-06 Thread kelbonage at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119141 --- Comment #5 from Nikl Kelbon --- (In reply to Sam James from comment #3) > (In reply to Nikl Kelbon from comment #2) > > This is not a bug about the difference in behavior of different compilers. > > Of course they will behave the same, they

[Bug libstdc++/119141] ub sanitizer incorrect overflow detection

2025-03-06 Thread kelbonage at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119141 --- Comment #4 from Nikl Kelbon --- (In reply to Sam James from comment #3) > (In reply to Nikl Kelbon from comment #2) > > This is not a bug about the difference in behavior of different compilers. > > Of course they will behave the same, they