This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Tidy-up instances of __STDCPP_DEFAULT_NEW_ALIGNMENT__ in the tests
ClosedPublic

Authored by ldionne on Jul 16 2021, 12:54 PM.

Diff Detail

Event Timeline

ldionne requested review of this revision.Jul 16 2021, 12:54 PM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2021, 12:54 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Quuxplusone requested changes to this revision.Jul 16 2021, 1:02 PM

LGTM % comments. Requesting changes, but I don't really need to see it again.

libcxx/test/std/containers/sequences/array/size_and_alignment.pass.cpp
47

Since this is >= 11, do we even need TEST_ALIGNXX, or could this be straightforwardly alignas(2 * alignof(std::max_align_t))?

libcxx/test/std/language.support/support.types/max_align_t.compile.pass.cpp
22–23

I believe it's safe to test these two traits in all modes. Just don't test is_pod unless TEST_STD_VER <= 17.

30

Since this is UNSUPPORTED: c++03, I think it's safe to use alignof(std::max_align_t) throughout instead of std::alignment_of<std::max_align_t>::value. std::alignment_of is at least en route to deprecation, if not there yet, and it'll be one less thing to worry about in the future.

This revision now requires changes to proceed.Jul 16 2021, 1:02 PM
ldionne updated this revision to Diff 359867.Jul 19 2021, 11:54 AM
ldionne marked 3 inline comments as done.

Address review feedback.

ldionne accepted this revision.Jul 19 2021, 4:36 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 19 2021, 4:37 PM
This revision was automatically updated to reflect the committed changes.
libcxx/test/std/language.support/support.types/max_align_t.compile.pass.cpp