[libcxx-commits] [libcxx] [libc++] Fix `unexpected` heterogeneous comparison (PR #115249)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 6 18:17:30 PST 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 30d80009e5012eba5f2e026375038e81932d84f6 921d491854e226b4a1b007ac7f0e250ea8663322 --extensions h,cpp -- libcxx/include/__expected/unexpected.h libcxx/test/std/utilities/expected/expected.unexpected/equality.pass.cpp
``````````

</details>

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

``````````diff
diff --git a/libcxx/test/std/utilities/expected/expected.unexpected/equality.pass.cpp b/libcxx/test/std/utilities/expected/expected.unexpected/equality.pass.cpp
index 7098ffc22c..95da2f2216 100644
--- a/libcxx/test/std/utilities/expected/expected.unexpected/equality.pass.cpp
+++ b/libcxx/test/std/utilities/expected/expected.unexpected/equality.pass.cpp
@@ -23,9 +23,7 @@
 struct Error{
   int i;
   friend constexpr bool operator==(const Error&, const Error&) = default;
-  friend constexpr bool operator==(const Error& lhs, int rhs) noexcept {
-    return lhs.i == rhs;
-  }
+  friend constexpr bool operator==(const Error& lhs, int rhs) noexcept { return lhs.i == rhs; }
 };
 
 constexpr bool test() {

``````````

</details>


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


More information about the libcxx-commits mailing list