Add an error diagnostic to Parse::ParseObjCMessageExpression().
This now exposes the following bug...
******************** TEST 'Sema/message.m' FAILED! ********************
Command:
clang -fsyntax-only -verify Sema/message.m
Output:
Errors seen but not expected:
Line 9: invalid receiver to message expression
******************** TEST 'Sema/message.m' FAILED! ********************
As far as I can tell, all messages to method agruments fail.
The method arguments are built by Sema::ObjcActOnStartOfMethodDef().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44022 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index 7cf551d..c3dae85 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -1243,6 +1243,7 @@
} else {
ExprResult Res = ParseAssignmentExpression();
if (Res.isInvalid) {
+ Diag(Tok, diag::err_invalid_receiver_to_message);
SkipUntil(tok::identifier);
return Res;
}