diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-10-12 20:00:44 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-10-12 20:00:44 +0000 |
commit | 04ea41c39a65b17fe8e5c4f8ba4caa9f3841f9cf (patch) | |
tree | ffa9d11355aa11f1cbb129f01934b91feca007af /clang/lib/Sema/SemaCXXScopeSpec.cpp | |
parent | 84d3779819c3b7278d85d76c33f9ca8cf9a4facc (diff) | |
download | bcm5719-llvm-04ea41c39a65b17fe8e5c4f8ba4caa9f3841f9cf.tar.gz bcm5719-llvm-04ea41c39a65b17fe8e5c4f8ba4caa9f3841f9cf.zip |
Fix typo correction of one qualified name to another.
When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly
replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken.
This corrects that replacement in as many places as I could find & provides
test cases for all those cases I could find a test case for. There are a couple
that don't seem to be reachable (one looks entirely dead, the other just
doesn't seem to ever get called with a namespace to namespace change).
Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ).
llvm-svn: 165817
Diffstat (limited to 'clang/lib/Sema/SemaCXXScopeSpec.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCXXScopeSpec.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaCXXScopeSpec.cpp b/clang/lib/Sema/SemaCXXScopeSpec.cpp index 0de9dd5f64c..15bfd1ce629 100644 --- a/clang/lib/Sema/SemaCXXScopeSpec.cpp +++ b/clang/lib/Sema/SemaCXXScopeSpec.cpp @@ -520,7 +520,8 @@ bool Sema::BuildCXXNestedNameSpecifier(Scope *S, if (LookupCtx) Diag(Found.getNameLoc(), diag::err_no_member_suggest) << Name << LookupCtx << CorrectedQuotedStr << SS.getRange() - << FixItHint::CreateReplacement(Found.getNameLoc(), CorrectedStr); + << FixItHint::CreateReplacement(Corrected.getCorrectionRange(), + CorrectedStr); else Diag(Found.getNameLoc(), diag::err_undeclared_var_use_suggest) << Name << CorrectedQuotedStr |