diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-03-14 22:56:43 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-03-14 22:56:43 +0000 |
commit | 57f8da506a0db208a936e26a8cb77267f638b26b (patch) | |
tree | aad09d1013d6f2f69af87e0bef0c48c058496d73 /test/SemaObjC | |
parent | 503836ae835fd27a4c1f1c1b6cbe72dfc5613976 (diff) |
Don't try to typo-correct 'super' in an objc method.
This created 2 issues:
1) Performance issue, since typo-correction with PCH/modules is rather expensive.
2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would
be emitted, like this:
3.m:8:3: error: unknown type name 'super'; did you mean 'super1'?
super.x = 0;
^~~~~
super1
t3.m:5:13: note: 'super1' declared here
typedef int super1;
^
t3.m:8:8: error: expected identifier or '('
super.x = 0;
^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177126 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjC')
-rw-r--r-- | test/SemaObjC/typo-correction.m | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/SemaObjC/typo-correction.m b/test/SemaObjC/typo-correction.m new file mode 100644 index 0000000000..cb2c91bb76 --- /dev/null +++ b/test/SemaObjC/typo-correction.m @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 %s -verify -fsyntax-only -Wspellcheck + +@interface B +@property int x; +@end + +@interface S : B +@end + +// Spell-checking 'undefined' is ok. +undefined var; // expected-warning {{spell-checking initiated}} \ + // expected-error {{unknown type name}} + +typedef int super1; +@implementation S +-(void)foo { + // Spell-checking 'super' is not ok. + super.x = 0; + self.x = 0; +} +@end |