r191545 - Don't give suggest things like function names on the left side of "=".
Kaelyn Uhrain
rikka at google.com
Fri Sep 27 12:40:16 PDT 2013
Author: rikka
Date: Fri Sep 27 14:40:16 2013
New Revision: 191545
URL: http://llvm.org/viewvc/llvm-project?rev=191545&view=rev
Log:
Don't give suggest things like function names on the left side of "=".
Modified:
cfe/trunk/lib/Parse/ParseStmt.cpp
cfe/trunk/test/SemaCXX/typo-correction-pt2.cpp
cfe/trunk/test/SemaObjC/ivar-ref-misuse.m
Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=191545&r1=191544&r2=191545&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Fri Sep 27 14:40:16 2013
@@ -130,6 +130,8 @@ public:
virtual bool ValidateCandidate(const TypoCorrection &candidate) {
if (FieldDecl *FD = candidate.getCorrectionDeclAs<FieldDecl>())
return isa<ObjCIvarDecl>(FD);
+ if (NextToken.is(tok::equal))
+ return candidate.getCorrectionDeclAs<VarDecl>();
return CorrectionCandidateCallback::ValidateCandidate(candidate);
}
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=191545&r1=191544&r2=191545&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/typo-correction-pt2.cpp (original)
+++ cfe/trunk/test/SemaCXX/typo-correction-pt2.cpp Fri Sep 27 14:40:16 2013
@@ -123,3 +123,8 @@ void testAccess() {
}
}
}
+
+long readline(const char *, char *, unsigned long);
+void assign_to_unknown_var() {
+ deadline_ = 1; // expected-error-re {{use of undeclared identifier 'deadline_'$}}
+}
Modified: cfe/trunk/test/SemaObjC/ivar-ref-misuse.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/ivar-ref-misuse.m?rev=191545&r1=191544&r2=191545&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/ivar-ref-misuse.m (original)
+++ cfe/trunk/test/SemaObjC/ivar-ref-misuse.m Fri Sep 27 14:40:16 2013
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
- at interface Sprite { // expected-note{{'Sprite' declared here}}
+ at interface Sprite {
int sprite, spree;
int UseGlobalBar;
}
@@ -17,8 +17,7 @@ int UseGlobalBar;
+ (void)setFoo:(int)foo {
sprite = foo; // expected-error {{instance variable 'sprite' accessed in class method}}
spree = foo;
- Xsprite = foo; // expected-error {{unknown type name 'Xsprite'; did you mean 'Sprite'?}} \
- // expected-error{{expected identifier or '('}}
+ Xsprite = foo; // expected-error {{use of undeclared identifier 'Xsprite'}}
UseGlobalBar = 10;
}
+ (void)setSprite:(int)sprite {
More information about the cfe-commits
mailing list