Does struct with reference member have unique object representation?
问题 This answer raised the following question. Suppose we have a simple struct S { int& i; } Internally (in GCC and Clang, at least) S contains just a pointer to an int , and static_assert(sizeof(int*) == 8); static_assert(sizeof(S) == 8); Does S have a unique object representation? GCC and Clang disagree *: static_assert( std::has_unique_object_representations_v<int*>); static_assert(!std::has_unique_object_representations_v<S>); // GCC static_assert( std::has_unique_object_representations_v<S>)