This makes the tests more minimal, and in particular it avoids relying on a complete <cstdlib>, which may not be available on all platforms.
Details
Details
- Reviewers
ldionne philnik - Group Reviewers
Restricted Project - Commits
- rGaa2b05f0b980: [libc++] Use stack buffers for uninitialized storage in tests.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM with the alignment bug fixed.
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp | ||
---|---|---|
40–41 | You could instead do union { P p; }; a.construct(&p); That would fix the alignment bug and avoid a reinterpret_cast. |
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp | ||
---|---|---|
40–41 | That doesn't work because the default constructors in question are non-trivial. How about using alignas instead? |
libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp | ||
---|---|---|
40–41 | Ah, I missed that. Then alignas is probably the correct call. |
You could instead do
That would fix the alignment bug and avoid a reinterpret_cast.