[ASTImporter] Fix import of ObjCPropertyDecl that share the same name
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 Reviewed By: shafik, kastiglione Differential Revision: https://reviews.llvm.org/D99077
Loading
Please sign in to comment