llvm-project/libcxx/test/std/utilities/smartptr/unique.ptr
Arthur O'Dwyer 1c6e752cfc [libc++] Better handling for zero-sized types.
Zero-sized types are a GCC extension, also supported by Clang.
In theory it's already invalid to `delete` a void pointer or a
pointer-to-incomplete, so we shouldn't need any special code
to catch those cases; but in practice Clang accepts both
constructs with just a warning, and GCC even accepts `sizeof(void)`
with just a warning! So we must keep the static_asserts.
The hard errors are tested in `unique_ptr_dltr_dflt/*.compile.fail.cpp`.

In ranges::begin/end, check `sizeof >= 0` instead of `sizeof != 0`,
so as to permit zero-sized types while still disallowing incomplete
types.

Fixes #54100.

Differential Revision: https://reviews.llvm.org/D120633
2022-03-07 11:50:00 -05:00
..
unique.ptr.class [libc++] Move several defines to ADDITIONAL_COMPILE_FLAGS in the test suite 2022-03-03 13:17:35 -05:00
unique.ptr.create [libc++] Better handling for zero-sized types. 2022-03-07 11:50:00 -05:00
unique.ptr.dltr [libc++] Remove Lit annotations for unsupported GCC versions from the test suite 2021-08-12 13:30:47 -04:00
unique.ptr.special [libc++] NFC: Fix several GCC warnings in the test suite 2020-10-30 12:48:05 -04:00
README.TXT

README.TXT

Test Naming and Directory Structure
===================================

The directory structure for the unique_ptr class templates differs from the
normal test directory naming conventions (e.g. matching the stable name in the standard).

Instead of having a [unique.ptr.single] and [unique.ptr.runtime] directory,
each containing their own tests, a single directory, "unique.ptr.class",
contains both sets of tests.

This allows the common behavior of the two unique_ptr specializations to be
tested in the same place without duplication.

Tests specific to [unique.ptr.single] have the suffix ".single.pass.cpp"
and those specific to [unique.ptr.runtime] are named "*.runtime.pass.cpp".
Tests for both specializations are named normally.