aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-11-12 19:18:37 +0000
committerSteve Naroff <snaroff@apple.com>2007-11-12 19:18:37 +0000
commit11508212aacde5199b0475a578a481febf5dc067 (patch)
treea95836deca57745251a54cb065348f0b259d27fb
parentec0aa78745f7b3bc96c20fffd1115bf26aaa0ead (diff)
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
-rw-r--r--Parse/ParseObjc.cpp1
-rw-r--r--include/clang/Basic/DiagnosticKinds.def2
2 files changed, 3 insertions, 0 deletions
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index 7cf551d0ae..c3dae856ea 100644
--- a/Parse/ParseObjc.cpp
+++ b/Parse/ParseObjc.cpp
@@ -1243,6 +1243,7 @@ Parser::ExprResult Parser::ParseObjCMessageExpression() {
} else {
ExprResult Res = ParseAssignmentExpression();
if (Res.isInvalid) {
+ Diag(Tok, diag::err_invalid_receiver_to_message);
SkipUntil(tok::identifier);
return Res;
}
diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def
index 8a65b7310e..a6e90b3025 100644
--- a/include/clang/Basic/DiagnosticKinds.def
+++ b/include/clang/Basic/DiagnosticKinds.def
@@ -322,6 +322,8 @@ DIAG(err_parse_error, ERROR,
"parse error")
DIAG(err_expected_expression, ERROR,
"expected expression")
+DIAG(err_invalid_receiver_to_message, ERROR,
+ "invalid receiver to message expression")
DIAG(err_expected_external_declaration, ERROR,
"expected external declaration")
DIAG(err_expected_ident, ERROR,