diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-02-21 21:40:44 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-02-21 21:40:44 +0000 |
commit | 63631bd173df1decfff98ae6a7ed7f3d5f886b86 (patch) | |
tree | e595d26fd20964fc67e009e39b140d4d4dcc5708 /lib/Sema/SemaExpr.cpp | |
parent | f11a705c6075b12cbae5632ba4de433bc9bc105f (diff) |
Teach serialized diagnostics about notes without locations.
Along the way, improve a diagnostic for "previous declaration here" for implicit parameters.
Fixes <rdar://problem/13211384>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 2858f36511..7411e809db 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1672,9 +1672,14 @@ bool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R, << SS.getRange() << FixItHint::CreateReplacement(Corrected.getCorrectionRange(), CorrectedStr); - if (ND) - Diag(ND->getLocation(), diag::note_previous_decl) + if (ND) { + unsigned diag = isa<ImplicitParamDecl>(ND) + ? diag::note_implicit_param_decl + : diag::note_previous_decl; + + Diag(ND->getLocation(), diag) << CorrectedQuotedStr; + } // Tell the callee to try to recover. return false; |