]> granicus.if.org Git - clang/commitdiff
Add an error diagnostic to Parse::ParseObjCMessageExpression().
authorSteve Naroff <snaroff@apple.com>
Mon, 12 Nov 2007 19:18:37 +0000 (19:18 +0000)
committerSteve Naroff <snaroff@apple.com>
Mon, 12 Nov 2007 19:18:37 +0000 (19:18 +0000)
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

Parse/ParseObjc.cpp
include/clang/Basic/DiagnosticKinds.def

index 7cf551d0ae184b03df39a7b496a4415558ab43ef..c3dae856eabf28a10f27645b7183424d0bbb094b 100644 (file)
@@ -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;
     }
index 8a65b7310e5b6e18bbd85cb99c470dbc064ab6c7..a6e90b30255b98017e24d03db84939ffe7fe0b35 100644 (file)
@@ -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,