looking for, reset the name within the LookupResult structure in
addition to clearing out the results. Fixes PR7508.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107197
91177308-0d34-0410-b5e6-
96231b3b80d8
if (NamedDecl *ND = Found.getAsSingle<NamedDecl>())
Diag(ND->getLocation(), diag::note_previous_decl)
<< ND->getDeclName();
- } else
+ } else {
Found.clear();
+ Found.setLookupName(&II);
+ }
}
NamedDecl *SD = Found.getAsSingle<NamedDecl>();
return true;
R.clear();
+ R.setLookupName(MemberOrBase);
}
}
<< Corrected;
NamespcName = Corrected.getAsIdentifierInfo();
+ } else {
+ R.clear();
+ R.setLookupName(NamespcName);
}
}
}
<< Corrected;
Ident = Corrected.getAsIdentifierInfo();
+ } else {
+ R.clear();
+ R.setLookupName(Ident);
}
}
return false;
} else {
R.clear();
+ R.setLookupName(Name);
}
return false;
IV->getNameAsString());
Diag(IV->getLocation(), diag::note_previous_decl)
<< IV->getDeclName();
+ } else {
+ Res.clear();
+ Res.setLookupName(Member);
}
}
// If we did not find any names, attempt to correct any typos.
DeclarationName Name = Found.getLookupName();
if (DeclarationName Corrected = CorrectTypo(Found, S, &SS, LookupCtx,
- false, CTC_CXXCasts)) {
+ false, CTC_CXXCasts)) {
FilterAcceptableTemplateNames(Context, Found);
if (!Found.empty()) {
if (LookupCtx)
}
} else {
Found.clear();
+ Found.setLookupName(Name);
}
}
x->A::foo<int>(); // expected-error {{'test5::A' is not a pointer}}
}
}
+
+namespace PR7508 {
+ struct A {
+ struct CleanupScope {};
+ void PopCleanupBlock();
+ };
+
+ void foo(A &a) {
+ a.PopCleanupScope(); // expected-error{{no member named 'PopCleanupScope' in 'PR7508::A'}}
+ }
+}