summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaLookup.cpp2
-rw-r--r--test/FixIt/typo-location-bugs.cpp13
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'?}}
+ }
+};
+}