[cfe-commits] r44022 - in /cfe/trunk: Parse/ParseObjc.cpp include/clang/Basic/DiagnosticKinds.def
Steve Naroff
snaroff at apple.com
Mon Nov 12 11:18:37 PST 2007
Author: snaroff
Date: Mon Nov 12 13:18:37 2007
New Revision: 44022
URL: http://llvm.org/viewvc/llvm-project?rev=44022&view=rev
Log:
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().
Modified:
cfe/trunk/Parse/ParseObjc.cpp
cfe/trunk/include/clang/Basic/DiagnosticKinds.def
Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=44022&r1=44021&r2=44022&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Mon Nov 12 13:18:37 2007
@@ -1243,6 +1243,7 @@
} else {
ExprResult Res = ParseAssignmentExpression();
if (Res.isInvalid) {
+ Diag(Tok, diag::err_invalid_receiver_to_message);
SkipUntil(tok::identifier);
return Res;
}
Modified: cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=44022&r1=44021&r2=44022&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticKinds.def Mon Nov 12 13:18:37 2007
@@ -322,6 +322,8 @@
"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,
More information about the cfe-commits
mailing list