summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/clang/Basic/DiagnosticParseKinds.td1
-rw-r--r--lib/Parse/Parser.cpp2
-rw-r--r--test/Parser/objc-quirks.m2
-rw-r--r--test/Parser/recovery.c2
4 files changed, 4 insertions, 3 deletions
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td
index e4a9fdc3a4..7675a566eb 100644
--- a/include/clang/Basic/DiagnosticParseKinds.td
+++ b/include/clang/Basic/DiagnosticParseKinds.td
@@ -119,6 +119,7 @@ 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_extraneous_closing_brace : Error<"extraneous closing brace ('}')">;
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 '{'">;
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index e09ee79c8c..db9460bca4 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -552,7 +552,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
// TODO: Invoke action for top-level semicolon.
return DeclGroupPtrTy();
case tok::r_brace:
- Diag(Tok, diag::err_expected_external_declaration);
+ Diag(Tok, diag::err_extraneous_closing_brace);
ConsumeBrace();
return DeclGroupPtrTy();
case tok::eof:
diff --git a/test/Parser/objc-quirks.m b/test/Parser/objc-quirks.m
index 72cb1e1d7c..0bdeb464e7 100644
--- a/test/Parser/objc-quirks.m
+++ b/test/Parser/objc-quirks.m
@@ -7,7 +7,7 @@ int @"s" = 5; // expected-error {{prefix attribute must be}}
// rdar://6480479
@interface A // expected-note {{class started here}}
}; // expected-error {{missing '@end'}} \
-// expected-error {{expected external declaration}} \
+// expected-error {{extraneous closing brace ('}')}} \
// expected-warning{{extra ';' outside of a function}}
diff --git a/test/Parser/recovery.c b/test/Parser/recovery.c
index 15fd12b715..3916acfda1 100644
--- a/test/Parser/recovery.c
+++ b/test/Parser/recovery.c
@@ -16,7 +16,7 @@ static void f (char * (*g) (char **, int), char **p, ...) {
// PR3172
-} // expected-error {{expected external declaration}}
+} // expected-error {{extraneous closing brace ('}')}}
// rdar://6094870