Fix has_unique_object_representation after Clang commit r324134.

Clang previously reported an empty union as having a unique object
representation. This was incorrect and was fixed in a recent Clang commit.

This patch fixes the libc++ tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@324153 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier 2018-02-02 22:39:59 +00:00
parent b2189c01fa
commit d33aaa939c

View File

@ -55,7 +55,8 @@ class NotEmpty
virtual ~NotEmpty(); virtual ~NotEmpty();
}; };
union Union {}; union EmptyUnion {};
struct NonEmptyUnion {int x; unsigned y;};
struct bit_zero struct bit_zero
{ {
@ -84,6 +85,7 @@ int main()
{ {
test_has_not_has_unique_object_representations<void>(); test_has_not_has_unique_object_representations<void>();
test_has_not_has_unique_object_representations<Empty>(); test_has_not_has_unique_object_representations<Empty>();
test_has_not_has_unique_object_representations<EmptyUnion>();
test_has_not_has_unique_object_representations<NotEmpty>(); test_has_not_has_unique_object_representations<NotEmpty>();
test_has_not_has_unique_object_representations<bit_zero>(); test_has_not_has_unique_object_representations<bit_zero>();
test_has_not_has_unique_object_representations<Abstract>(); test_has_not_has_unique_object_representations<Abstract>();
@ -97,7 +99,7 @@ int main()
test_has_unique_object_representations<unsigned>(); test_has_unique_object_representations<unsigned>();
test_has_unique_object_representations<Union>(); test_has_unique_object_representations<NonEmptyUnion>();
test_has_unique_object_representations<char[3]>(); test_has_unique_object_representations<char[3]>();
test_has_unique_object_representations<char[]>(); test_has_unique_object_representations<char[]>();