This is an archive of the discontinued LLVM Phabricator instance.

clang: Don't assert on no_unique_address fields in @encode()
ClosedPublic

Authored by thakis on Nov 2 2020, 9:03 AM.

Details

Summary

Just skip (non-bitfield) zero-sized fields, like we do with empty bases.

The class->struct conversion in the test is because -std=c++20 else deletes some default methods
due to non-accessible base dtors otherwise.

As a side-effect of writing the test, I discovered that D76801 did an ABI breaking change of sorts
for Objective-C's @encode. But it's been in for a while, so I'm not sure if we want to row back on
that or now.

Fixes PR48048.

Diff Detail