[llvm-branch-commits] [cfe-branch] r227280 - Merging r227278:

Hans Wennborg hans at hanshq.net
Tue Jan 27 17:08:24 PST 2015


Author: hans
Date: Tue Jan 27 19:08:23 2015
New Revision: 227280

URL: http://llvm.org/viewvc/llvm-project?rev=227280&view=rev
Log:
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.
------------------------------------------------------------------------

Modified:
    cfe/branches/release_36/   (props changed)
    cfe/branches/release_36/lib/Sema/SemaLookup.cpp
    cfe/branches/release_36/test/FixIt/typo-location-bugs.cpp

Propchange: cfe/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 27 19:08:23 2015
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:226008,226049,226136,226282,226624,226707,226754,226863,226877,227062,227220,227251
+/cfe/trunk:226008,226049,226136,226282,226624,226707,226754,226863,226877,227062,227220,227251,227278
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_36/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/Sema/SemaLookup.cpp?rev=227280&r1=227279&r2=227280&view=diff
==============================================================================
--- cfe/branches/release_36/lib/Sema/SemaLookup.cpp (original)
+++ cfe/branches/release_36/lib/Sema/SemaLookup.cpp Tue Jan 27 19:08:23 2015
@@ -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;

Modified: cfe/branches/release_36/test/FixIt/typo-location-bugs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/FixIt/typo-location-bugs.cpp?rev=227280&r1=227279&r2=227280&view=diff
==============================================================================
--- cfe/branches/release_36/test/FixIt/typo-location-bugs.cpp (original)
+++ cfe/branches/release_36/test/FixIt/typo-location-bugs.cpp Tue Jan 27 19:08:23 2015
@@ -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'?}}
+  }
+};
+}





More information about the llvm-branch-commits mailing list