https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100903

--- Comment #18 from Philipp Fent <philipp at fent dot de> ---
(In reply to Jonathan Wakely from comment #17)
> Do you mean comparing durations to each other, or when comparing the result
> of such a comparison to 0? The former would be surprising

I also see this without any comparison to 0, but only in template functions.
Bug 125165 has a simple reproducer without std::chrono::duration, but it also
triggers with that: https://compiler-explorer.com/z/r75scGfsn

#include <chrono>

template <int>
bool testTemplate() {
   // Triggers: -Wzero-as-null-pointer-constant
   return std::chrono::milliseconds(1) < std::chrono::milliseconds(2);
}

bool test() {
   return testTemplate<3>();
}

Reply via email to