GCC complains about a memcpy in SmallSet.h It seems that it contains an object with no trivial copy-assignment. We'd rather eplace the memcpy with assignments of the private members. Error: WTF/Headers/wtf/SmallSet.h:70:15: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class WTF::SmallSet<WTF::UniquedStringImpl*’ with no trivial copy-assignment [-Wclass-memaccess] 70 | memcpy(this, &other, sizeof(SmallSet)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ WTF/Headers/wtf/SmallSet.h:44:7: note: ‘class WTF::SmallSet<WTF::UniquedStringImpl*>’ declared here 44 | class SmallSet {
Created attachment 429512 [details] Patch
<rdar://problem/78679329>
Comment on attachment 429512 [details] Patch Found this when searching for -Wclass-memaccess warnings. It will need to be rebased because I added void casts at some point to suppress this warning. Your solution is better.
Comment on attachment 429512 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429512&action=review > Source/WTF/wtf/SmallSet.h:72 > + this->m_size = other.m_size; > + this->m_capacity = other.m_capacity; > + this->m_inline = other.m_inline; We can also omit the "this->" here.