Objective-C apparently allows name conflicts between instance and class properties, so this
is valid code:
@protocol DupProp @property (class, readonly) int prop; @property (readonly) int prop; @end
The ASTImporter however isn't aware of this and will consider the two properties as if
they are the same property because it just compares their name and types. This causes
that when importing both properties we only end up with one property (whatever is
imported first from what I can see).
Beside generating a different AST this also leads to a bunch of asserts and crashes as
we still correctly import the two different getters for both properties (the import code
for methods does the correct check where it differentiated between instance and
class methods). As one of the setters will not have its associated ObjCPropertyDecl
imported, any call to ObjCMethodDecl::findPropertyDecl will just lead to an assert
or crash.
Fixes rdar://74322659
I'm a little surprised to see the test use a protocol and not a class. Is there any specific reason for that, or does the choice not matter?