Attached is a patch for bug 6464
(http://llvm.org/bugs/show_bug.cgi?id=6484). This adds to the existing
error message to indicate there may be a stray/extraneous closing
brace ('}'). It also updates the 2 test cases I found (all tests
pass).

This is my first patch to clang/llvm. I hope to make more of these
types of bug fixes until I become comfortable; let me know if I am
doing things incorrectly so that I can correct it for future patches.

-Jason "s1n" Switzer
Index: test/Parser/recovery.c
===================================================================
--- test/Parser/recovery.c	(revision 148209)
+++ test/Parser/recovery.c	(working copy)
@@ -16,7 +16,7 @@
 
 
 // PR3172
-} // expected-error {{expected external declaration}}
+} // expected-error {{expected external declaration or extraneous '}'}}
 
 
 // rdar://6094870
Index: test/Parser/objc-quirks.m
===================================================================
--- test/Parser/objc-quirks.m	(revision 148209)
+++ test/Parser/objc-quirks.m	(working copy)
@@ -7,7 +7,7 @@
 // rdar://6480479
 @interface A // expected-note {{class started here}}
 }; // expected-error {{missing '@end'}} \
-// expected-error {{expected external declaration}} \
+// expected-error {{expected external declaration or extraneous '}'}} \
 // expected-warning{{extra ';' outside of a function}}
 
 
Index: include/clang/Basic/DiagnosticParseKinds.td
===================================================================
--- include/clang/Basic/DiagnosticParseKinds.td	(revision 148209)
+++ include/clang/Basic/DiagnosticParseKinds.td	(working copy)
@@ -118,7 +118,8 @@
 def err_parse_error : Error<"parse error">;
 def err_expected_expression : Error<"expected expression">;
 def err_expected_type : Error<"expected a type">;
-def err_expected_external_declaration : Error<"expected external declaration">;
+def err_expected_external_declaration : Error<
+  "expected external declaration or extraneous '}'">;
 def err_expected_ident : Error<"expected identifier">;
 def err_expected_ident_lparen : Error<"expected identifier or '('">;
 def err_expected_ident_lbrace : Error<"expected identifier or '{'">;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to