From: Chris Lattner Date: Fri, 27 Feb 2009 17:15:01 +0000 (+0000) Subject: change a diagnostic message from something pedantically correct but X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51a75d0cc7651753399efdc3176feaee6214c3ca;p=clang change a diagnostic message from something pedantically correct but useless to something more vague but hopefully more clear. rdar://6624173 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65639 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticParseKinds.def b/include/clang/Basic/DiagnosticParseKinds.def index 703d6b875c..dc08aed29c 100644 --- a/include/clang/Basic/DiagnosticParseKinds.def +++ b/include/clang/Basic/DiagnosticParseKinds.def @@ -118,8 +118,8 @@ DIAG(err_expected_fn_body, ERROR, "expected function body after function declarator") DIAG(err_expected_method_body, ERROR, "expected method body") -DIAG(err_expected_after_declarator, ERROR, - "expected '=', ',', ';', 'asm', or '__attribute__' after declarator") +DIAG(err_invalid_token_after_toplevel_declarator, ERROR, + "invalid token after top level declarator") DIAG(err_expected_statement, ERROR, "expected statement") DIAG(err_expected_lparen_after, ERROR, diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index a67106c4d9..134f477634 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -499,8 +499,8 @@ Parser::ParseDeclarationOrFunctionDefinition( // FALL THROUGH. } else if (DeclaratorInfo.isFunctionDeclarator() && (Tok.is(tok::l_brace) || // int X() {} - ( !getLang().CPlusPlus && - isDeclarationSpecifier() ))) { // int X(f) int f; {} + (!getLang().CPlusPlus && + isDeclarationSpecifier()))) { // int X(f) int f; {} if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef) { Diag(Tok, diag::err_function_declared_typedef); @@ -520,7 +520,7 @@ Parser::ParseDeclarationOrFunctionDefinition( if (DeclaratorInfo.isFunctionDeclarator()) Diag(Tok, diag::err_expected_fn_body); else - Diag(Tok, diag::err_expected_after_declarator); + Diag(Tok, diag::err_invalid_token_after_toplevel_declarator); SkipUntil(tok::semi); return 0; } diff --git a/test/Lexer/block_cmt_end.c b/test/Lexer/block_cmt_end.c index 1f0eefddf2..d049c02872 100644 --- a/test/Lexer/block_cmt_end.c +++ b/test/Lexer/block_cmt_end.c @@ -26,7 +26,7 @@ next comment ends with a trigraph escaped newline: */ /* expected-warning {{escaped newline between}} expected-warning {{backslash and newline separated by space}} expected-warning {{trigraph ends block comment}} *??/ / -foo /* expected-error {{expected '=', ',', ';', 'asm', or '__attribute__' after declarator}} */ +foo /* expected-error {{invalid token after top level declarator}} */ // rdar://6060752 - We should not get warnings about trigraphs in comments: diff --git a/test/Parser/objc-foreach-error-1.m b/test/Parser/objc-foreach-error-1.m index 76251abf33..e65c329005 100644 --- a/test/Parser/objc-foreach-error-1.m +++ b/test/Parser/objc-foreach-error-1.m @@ -1,6 +1,6 @@ // RUN: clang -fsyntax-only -verify %s -ce MyList // expected-error {{expected '=', ',', ';', 'asm', or '__attribute__' after declarator}} +ce MyList // expected-error {{invalid token after top level declarator}} @end