diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp index 410c1db7244d..c1cbccba04b7 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_empty.pass.cpp @@ -11,6 +11,14 @@ // is_empty +// T is a non-union class type with: +// no non-static data members, +// no unnamed bit-fields of non-zero length, +// no virtual member functions, +// no virtual base classes, +// and no base class B for which is_empty_v is false. + + #include #include "test_macros.h" @@ -44,22 +52,33 @@ void test_is_not_empty() #endif } -class Empty -{ -}; +class Empty {}; +struct NotEmpty { int foo; }; -class NotEmpty +class VirtualFn { - virtual ~NotEmpty(); + virtual ~VirtualFn(); }; union Union {}; +struct EmptyBase : public Empty {}; +struct VirtualBase : virtual Empty {}; +struct NotEmptyBase : public NotEmpty {}; + +struct StaticMember { static int foo; }; +struct NonStaticMember { int foo; }; + struct bit_zero { int : 0; }; +struct bit_one +{ + int : 1; +}; + int main() { test_is_not_empty(); @@ -72,7 +91,14 @@ int main() test_is_not_empty(); test_is_not_empty(); test_is_not_empty(); + test_is_not_empty(); + test_is_not_empty(); + test_is_not_empty(); + test_is_not_empty(); + test_is_empty(); test_is_empty(); + test_is_empty(); + test_is_empty(); test_is_empty(); }