Fix <rdar://problem/6150376> [sema] crash on invalid message send.

The core fix in Sema::ActOnClassMessage(). All the other changes have to do with passing down the SourceLocation for the receiver (to properly position the cursor when producing an error diagnostic).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59639 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/super.m b/test/SemaObjC/super.m
index 46b8b4a..243b84c 100644
--- a/test/SemaObjC/super.m
+++ b/test/SemaObjC/super.m
@@ -23,3 +23,17 @@
   [super cMethod]; // expected-warning{{method '+cMethod' not found (return type defaults to 'id')}}
 }
 @end
+
+@interface XX
+- m;
+@end
+
+void f(id super) {
+  [super m];
+}
+void f0(int super) {
+  [super m]; // expected-error{{bad receiver type 'int'}}
+}
+void f1(int puper) {
+  [super m]; // expected-error{{use of undeclared identifier 'super'}}
+}