Skip to content

[libc] Fix usage of std::nullptr_t in LibcTest.h. #114321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Oct 30, 2024

No description provided.

@llvmbot llvmbot added the libc label Oct 30, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 30, 2024

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/114321.diff

1 Files Affected:

  • (modified) libc/test/UnitTest/LibcTest.h (+1-1)
diff --git a/libc/test/UnitTest/LibcTest.h b/libc/test/UnitTest/LibcTest.h
index 1707c3c0fdcfad..b4e3819ea958de 100644
--- a/libc/test/UnitTest/LibcTest.h
+++ b/libc/test/UnitTest/LibcTest.h
@@ -165,7 +165,7 @@ class Test {
   // 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,
+  bool test(TestCond Cond, ValType LHS, cpp::nullptr_t, const char *LHSStr,
             const char *RHSStr, internal::Location Loc) {
     return test(Cond, LHS, static_cast<ValType>(nullptr), LHSStr, RHSStr, Loc);
   }

Copy link
Member

@nickdesaulniers nickdesaulniers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider including what you use

libc/src/__support/CPP/type_traits/is_null_pointer.h

@lntue
Copy link
Contributor Author

lntue commented Oct 30, 2024

Consider including what you use

libc/src/__support/CPP/type_traits/is_null_pointer.h

All headers inside src/__support/CPP/type_traits/* are included in src/__support/CPP/type_traits.h, which is included at the beginning of the file, and I don't think we want to include individual type trait headers. That being said, we should have nullptr_t.h header separated somewhere, and not included inside type_traits/is_null_pointer.h.

@lntue lntue merged commit a39fb30 into llvm:main Oct 30, 2024
6 of 7 checks passed
@lntue lntue deleted the fixtest branch October 30, 2024 23:09
smallp-o-p pushed a commit to smallp-o-p/llvm-project that referenced this pull request Nov 3, 2024
NoumanAmir657 pushed a commit to NoumanAmir657/llvm-project that referenced this pull request Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants