def warn_semicolon_before_method_body : Warning<
"semicolon before method body is ignored">,
InGroup<DiagGroup<"semicolon-before-method-body">>, DefaultIgnore;
+def note_extra_comma_message_arg : Note<
+ "comma separating objective-c messaging arguments">;
def err_expected_field_designator : Error<
"expected a field designator, such as '.field = 4'">;
}
// Parse the, optional, argument list, comma separated.
while (Tok.is(tok::comma)) {
- ConsumeToken(); // Eat the ','.
+ SourceLocation commaLoc = ConsumeToken(); // Eat the ','.
/// Parse the expression after ','
ExprResult Res(ParseAssignmentExpression());
if (Res.isInvalid()) {
+ if (Tok.is(tok::colon)) {
+ Diag(commaLoc, diag::note_extra_comma_message_arg) <<
+ FixItHint::CreateRemoval(commaLoc);
+ }
// We must manually skip to a ']', otherwise the expression skipper will
// stop at the ']' when it skips to the ';'. We want it to skip beyond
// the enclosing expression.
--- /dev/null
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c %s 2>&1 | FileCheck %s
+// rdar://11376372
+
+@class NSObject;
+
+@interface TestObj {
+}
+-(void)aMethodWithArg1:(NSObject*)arg1 arg2:(NSObject*)arg2;
+@end
+
+int main(int argc, char *argv[])
+{
+ TestObj *obj;
+ [obj aMethodWithArg1:@"Arg 1 Good", arg2:@"Arg 2 Good"];
+}
+
+// CHECK: {14:39-14:40}:""