[libc-commits] [libc] [libc] fix behavior of strrchr(x, '\0') (PR #112620)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Wed Oct 30 15:56:48 PDT 2024


================
@@ -162,6 +162,14 @@ class Test {
                           (unsigned long long)RHS, LHSStr, RHSStr, Loc);
   }
 
+  // Helper to allow macro invocations like `ASSERT_EQ(foo, nullptr)`.
+  template <typename ValType,
+            cpp::enable_if_t<cpp::is_pointer_v<ValType>, ValType> = nullptr>
+  bool test(TestCond Cond, ValType LHS, std::nullptr_t, const char *LHSStr,
----------------
nickdesaulniers wrote:

We have libc/src/__support/CPP/type_traits/is_null_pointer.h which defines `cpp::nullptr_t`.  That include and that value should be used in place of `std::nullptr_t` I suspect.

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


More information about the libc-commits mailing list