Skip to content

Commit 8a2dd80

Browse files
committed
Fix latent bug that causes spurious ambiguous member lookups
This should have been fixed in #78673 but it was missed because it requires a fairly complex trigger. The fix is to ensure that we never try to clone inherited methods that are themselves inherited.
1 parent 1f853c0 commit 8a2dd80

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6223,6 +6223,11 @@ TinyPtrVector<ValueDecl *> ClangRecordMemberLookup::evaluate(
62236223

62246224
auto memberClangDecl = namedMember->getClangDecl();
62256225

6226+
// Skip this base class member if it isn't from recordDecl; this happens
6227+
// when this member was inherited.
6228+
if (memberClangDecl != recordDecl->getClangDecl())
6229+
continue;
6230+
62266231
// Skip this base class if this is a case of nested private inheritance.
62276232
//
62286233
// BUG: private base class members should be inherited but inaccessible.

0 commit comments

Comments
 (0)