diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-01-28 01:08:23 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-01-28 01:08:23 +0000 |
commit | 76d233c3472e061dbe64101040fde2e0e8644895 (patch) | |
tree | 05dc790f008982c12ad77e0bab659213caa50231 | |
parent | beb9936b46b8c672e813b3421221c3b788753b9b (diff) |
Merging r227278:
------------------------------------------------------------------------
r227278 | rikka | 2015-01-27 16:46:09 -0800 (Tue, 27 Jan 2015) | 6 lines
Use the real CXXScopeSpec when setting the correction SourceRange.
Otherwise, in the most important case and the only case where SS and
TempSS are different (which is when the CXXScopeSpec should be dropped,
and TempSS is NULL) the wrong SourceRange will be used in the fixit for
the typo correction. Fixes the remaining issue in PR20626.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@227280 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 2 | ||||
-rw-r--r-- | test/FixIt/typo-location-bugs.cpp | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 3445264461..a6cd653e89 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -3587,7 +3587,7 @@ retry_lookup: QualifiedResults.push_back(Candidate); break; } - Candidate.setCorrectionRange(TempSS, Result.getLookupNameInfo()); + Candidate.setCorrectionRange(SS.get(), Result.getLookupNameInfo()); return true; } return false; diff --git a/test/FixIt/typo-location-bugs.cpp b/test/FixIt/typo-location-bugs.cpp index e44664d49a..c7111a8010 100644 --- a/test/FixIt/typo-location-bugs.cpp +++ b/test/FixIt/typo-location-bugs.cpp @@ -34,3 +34,16 @@ void test(B b) { b.f(1); // expected-error{{too many arguments to function call, expected 0, have 1; did you mean 'A::f'?}} } } + +namespace PR20626 { +class A { +public: + void Foo(){}; // expected-note{{'Foo' declared here}} +}; +class B {}; +class C : public A, public B { + void Run() { + B::Foo(); // expected-error{{no member named 'Foo' in 'PR20626::B'; did you mean simply 'Foo'?}} + } +}; +} |