]> granicus.if.org Git - clang/commit
Implement typo correction for Objective-C message sends when the
authorDouglas Gregor <dgregor@apple.com>
Wed, 14 Apr 2010 02:46:37 +0000 (02:46 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 14 Apr 2010 02:46:37 +0000 (02:46 +0000)
commit47bd54392a4fd0f10e04de6a0420fd4838caaa0e
treea70cfcbd611a1a518bc3bee7617695e13984cb96
parent1dbca6ea983231b4cab1a8f1edda8f6e13c21f12
Implement typo correction for Objective-C message sends when the
receiver is a mis-typed class name. Previously, we would give a non-specific
typo-correction diagnostic from the expression-parsing code, but there
was no fix-it because it was too late to recover. Now, we give a nice
diagnostic

honk.m:6:4: error: unknown receiver 'Hnk'; did you mean 'Honk'?
  [Hnk method];
   ^~~
   Honk
honk.m:1:1: note: 'Honk' declared here
@interface Honk
^

which includes a fix-it.

We still need to recover better from mis-typing "super".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101211 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/Sema.h
lib/Sema/SemaExprObjC.cpp
test/FixIt/typo.m