aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2012-01-18 05:58:54 +0000
committerKaelyn Uhrain <rikka@google.com>2012-01-18 05:58:54 +0000
commit4798f8dfdb15fc03fa6b4104efed8762d52ebb18 (patch)
tree9d2df7fbbe37f8a2565e2dc49f30b142382f720e /lib/Sema/SemaExpr.cpp
parent4c3fc9b38d3723f73e4ded594cebf38c76f91d93 (diff)
Convert DiagnoseEmptyLookup to use correction callbacks.
No new unit tests yet as there is no behavioral change (except for slightly more specific filtering in Sema::ActOnStartOfLambdaDefinition). Tests will be added as the code paths are traced in greater depth to determine how to improve the results--there are at least one or two known bugs that require those improvements. This commit lays the groundwork for those changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 3eda420940..119151a3af 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1487,7 +1487,7 @@ Sema::DecomposeUnqualifiedId(const UnqualifiedId &Id,
///
/// \return false if new lookup candidates were found
bool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R,
- CorrectTypoContext CTC,
+ CorrectionCandidateCallback &CCC,
TemplateArgumentListInfo *ExplicitTemplateArgs,
Expr **Args, unsigned NumArgs) {
DeclarationName Name = R.getLookupName();
@@ -1602,7 +1602,7 @@ bool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R,
// We didn't find anything, so try to correct for a typo.
TypoCorrection Corrected;
if (S && (Corrected = CorrectTypo(R.getLookupNameInfo(), R.getLookupKind(),
- S, &SS, NULL, false, CTC))) {
+ S, &SS, &CCC))) {
std::string CorrectedStr(Corrected.getAsString(getLangOptions()));
std::string CorrectedQuotedStr(Corrected.getQuoted(getLangOptions()));
R.setLookupName(Corrected.getCorrection());
@@ -1817,7 +1817,8 @@ ExprResult Sema::ActOnIdExpression(Scope *S,
return ActOnDependentIdExpression(SS, NameInfo, IsAddressOfOperand,
TemplateArgs);
- if (DiagnoseEmptyLookup(S, SS, R, CTC_Unknown))
+ CorrectionCandidateCallback DefaultValidator;
+ if (DiagnoseEmptyLookup(S, SS, R, DefaultValidator))
return ExprError();
assert(!R.empty() &&