]> granicus.if.org Git - clang/commitdiff
Fix a typo suggestion regression introduced by r191544.
authorKaelyn Uhrain <rikka@google.com>
Tue, 1 Oct 2013 22:00:28 +0000 (22:00 +0000)
committerKaelyn Uhrain <rikka@google.com>
Tue, 1 Oct 2013 22:00:28 +0000 (22:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191798 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseStmt.cpp
test/SemaCXX/typo-correction-pt2.cpp

index 28580ab2bb750bcd1fff2c3bf04604cc132bd1f6..ef1ab89b8c956637399ceb9f5aec0037e7298804 100644 (file)
@@ -129,7 +129,7 @@ public:
 
   virtual bool ValidateCandidate(const TypoCorrection &candidate) {
     if (FieldDecl *FD = candidate.getCorrectionDeclAs<FieldDecl>())
-      return isa<ObjCIvarDecl>(FD);
+      return !candidate.getCorrectionSpecifier() || isa<ObjCIvarDecl>(FD);
     if (NextToken.is(tok::equal))
       return candidate.getCorrectionDeclAs<VarDecl>();
     if (NextToken.is(tok::period) &&
index 9c7fb14ccfd1223feef4e2a8374fc4ac2cae07ac..f360649cccda68cde373591e066e18144521da46 100644 (file)
@@ -144,3 +144,10 @@ namespace PR17394 {
   class B : private A {};
   B zzzzzzzzzy<>; // expected-error {{expected ';' after top level declarator}}{}
 }
+
+namespace correct_fields_in_member_funcs {
+struct S {
+  int my_member;  // expected-note {{'my_member' declared here}}
+  void f() { my_menber = 1; }  // expected-error {{use of undeclared identifier 'my_menber'; did you mean 'my_member'?}}
+};
+}