[libcxx-commits] [libcxx] [libc++][chrono] Fix streaming for unsigned durations. (PR #97889)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 9 22:59:06 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff f90bac99e19d4243ac52cf6e18aa374f9a8754cb a782925a5c811d039d2bde528868449e3556f9a6 -- libcxx/include/__chrono/formatter.h libcxx/test/std/time/time.duration/time.duration.nonmember/ostream.pass.cpp libcxx/test/std/time/time.syn/formatter.duration.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/__chrono/formatter.h b/libcxx/include/__chrono/formatter.h
index 4011a458cd..9a77316385 100644
--- a/libcxx/include/__chrono/formatter.h
+++ b/libcxx/include/__chrono/formatter.h
@@ -590,8 +590,8 @@ __format_chrono(const _Tp& __value,
     __sstr << __value;
   else {
     if constexpr (chrono::__is_duration<_Tp>::value) {
-	  // A duration can be a user defined arithmetic type. Users may specialize
-	  // numeric_limits, but they may not specialize is_signed.
+      // A duration can be a user defined arithmetic type. Users may specialize
+      // numeric_limits, but they may not specialize is_signed.
       if constexpr (numeric_limits<typename _Tp::rep>::is_signed) {
         if (__value < __value.zero()) {
           __sstr << _CharT('-');

``````````

</details>


https://github.com/llvm/llvm-project/pull/97889


More information about the libcxx-commits mailing list