diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-08-17 00:46:16 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-08-17 00:46:16 +0000 |
commit | 2d67097ad41f4c2fe82ebce3f587e06498f1bd71 (patch) | |
tree | dd6cae767852e74d46c2fd18b46e5630c73c96f8 /lib/Sema/SemaTemplateVariadic.cpp | |
parent | 2845a6746f6320994675a9a413ecbe5252d4dc02 (diff) |
Refactor all diagnosing of TypoCorrections through a common function, in
preparation for teaching this function how to diagnose a correction that
includes importing a module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateVariadic.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateVariadic.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp index 6298332dc1..78aa7f893a 100644 --- a/lib/Sema/SemaTemplateVariadic.cpp +++ b/lib/Sema/SemaTemplateVariadic.cpp @@ -819,16 +819,12 @@ ExprResult Sema::ActOnSizeofParameterPackExpr(Scope *S, if (TypoCorrection Corrected = CorrectTypo(R.getLookupNameInfo(), R.getLookupKind(), S, 0, Validator)) { - std::string CorrectedQuotedStr(Corrected.getQuoted(getLangOpts())); + diagnoseTypo(Corrected, + PDiag(diag::err_sizeof_pack_no_pack_name_suggest) << &Name, + PDiag(diag::note_parameter_pack_here)); ParameterPack = Corrected.getCorrectionDecl(); - Diag(NameLoc, diag::err_sizeof_pack_no_pack_name_suggest) - << &Name << CorrectedQuotedStr - << FixItHint::CreateReplacement( - NameLoc, Corrected.getAsString(getLangOpts())); - Diag(ParameterPack->getLocation(), diag::note_parameter_pack_here) - << CorrectedQuotedStr; } - + case LookupResult::FoundOverloaded: case LookupResult::FoundUnresolvedValue: break; |