Close https://github.com/llvm/llvm-project/issues/61601
I tried to insert checks in the front of LookupResult::isAvailableForLookup() and other similar places in SemaLookup. But it can't address the above issue correctly.
So I think it may be best to make the entities to be hidden from the lookup from the beginning.
@iains I know this may interfere your current work. So I ping you to wish this one won't bring troubles to you. And I'm wondering if we can implement P1815 simpler by similar methods. (I tried this can't implement P1815 precisely)
It would be good to deal with this during the deserialisation, however I am not sure that we have enough information to know what rules to apply at this point:
If we can implement those rules here, then that would be most efficient.