This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Add tests for the content of <cstddef>
ClosedPublic

Authored by ldionne on Mar 7 2022, 5:43 AM.

Details

Reviewers
Quuxplusone
Group Reviewers
Restricted Project
Commits
rG071762199f19: [libc++] Add tests for the content of <cstddef>
Summary

As discussed in D114786.

Diff Detail

Event Timeline

ldionne created this revision.Mar 7 2022, 5:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 5:43 AM
ldionne requested review of this revision.Mar 7 2022, 5:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 5:43 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Quuxplusone requested changes to this revision.Mar 7 2022, 7:50 AM
Quuxplusone added a subscriber: Quuxplusone.
Quuxplusone added inline comments.
libcxx/test/libcxx/language.support/support.types/cstddef.compile.pass.cpp
19

The first was presumably a typo, but let's test both here, since otherwise we have no coverage for std::nullptr_t-in-C++03-mode.
Actually, you should probably just copy-paste the other test into this one and test all the things, e.g. ::max_align_t.

libcxx/test/std/language.support/support.types/cstddef.compile.pass.cpp
46
This revision now requires changes to proceed.Mar 7 2022, 7:50 AM
ldionne updated this revision to Diff 414367.Mar 10 2022, 6:14 AM
ldionne marked 2 inline comments as done.

Address review comments.

libcxx/test/libcxx/language.support/support.types/cstddef.compile.pass.cpp
19

Good catch.

libcxx/test/std/language.support/support.types/cstddef.compile.pass.cpp
34

std::nullptr_t is also provided in C++03 mode, right? So this line (and maybe the other too) should go outside the #if, so they get tested in all modes.
(The only compiler+library combo that's ever tested in C++03 mode is clang+libc++, which does provide std::nullptr_t, so there's no reason to guard it under an #if.)

Otherwise we have no coverage for std::nullptr_t-in-C++03-mode.

ldionne updated this revision to Diff 414401.Mar 10 2022, 9:08 AM
ldionne marked an inline comment as done.

Address review comments.

libcxx/test/std/language.support/support.types/cstddef.compile.pass.cpp
34

Hmm, right. I'd still rather move that test to the libc++ specific test, just for clarity. But yeah, good catch again. I guess I don't care enough about C++03!

ldionne accepted this revision as: Restricted Project.Mar 10 2022, 12:53 PM

All comments have been addressed, this should be fairly uncontroversial to land now. Can address post-commit if needed. Thanks for the review!

This revision was not accepted when it landed; it landed in state Needs Review.Mar 10 2022, 12:54 PM
This revision was automatically updated to reflect the committed changes.