r191798 - Fix a typo suggestion regression introduced by r191544.
Kaelyn Uhrain
rikka at google.com
Tue Oct 1 15:00:28 PDT 2013
Author: rikka
Date: Tue Oct 1 17:00:28 2013
New Revision: 191798
URL: http://llvm.org/viewvc/llvm-project?rev=191798&view=rev
Log:
Fix a typo suggestion regression introduced by r191544.
Modified:
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/test/SemaCXX/typo-correction-pt2.cpp
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=191798&r1=191797&r2=191798&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Tue Oct 1 17:00:28 2013
@@ -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) &&
Modified: cfe/trunk/test/SemaCXX/typo-correction-pt2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typo-correction-pt2.cpp?rev=191798&r1=191797&r2=191798&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/typo-correction-pt2.cpp (original)
+++ cfe/trunk/test/SemaCXX/typo-correction-pt2.cpp Tue Oct 1 17:00:28 2013
@@ -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'?}}
+};
+}
More information about the cfe-commits
mailing list