[cfe-commits] r65639 - in /cfe/trunk: include/clang/Basic/DiagnosticParseKinds.def lib/Parse/Parser.cpp test/Lexer/block_cmt_end.c test/Parser/objc-foreach-error-1.m

Chris Lattner sabre at nondot.org
Fri Feb 27 09:15:01 PST 2009


Author: lattner
Date: Fri Feb 27 11:15:01 2009
New Revision: 65639

URL: http://llvm.org/viewvc/llvm-project?rev=65639&view=rev
Log:
change a diagnostic message from something pedantically correct but
useless to something more vague but hopefully more clear.
rdar://6624173

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.def
    cfe/trunk/lib/Parse/Parser.cpp
    cfe/trunk/test/Lexer/block_cmt_end.c
    cfe/trunk/test/Parser/objc-foreach-error-1.m

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.def?rev=65639&r1=65638&r2=65639&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.def Fri Feb 27 11:15:01 2009
@@ -118,8 +118,8 @@
      "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,

Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=65639&r1=65638&r2=65639&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Fri Feb 27 11:15:01 2009
@@ -499,8 +499,8 @@
     // 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 @@
     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;
   }

Modified: cfe/trunk/test/Lexer/block_cmt_end.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/block_cmt_end.c?rev=65639&r1=65638&r2=65639&view=diff

==============================================================================
--- cfe/trunk/test/Lexer/block_cmt_end.c (original)
+++ cfe/trunk/test/Lexer/block_cmt_end.c Fri Feb 27 11:15:01 2009
@@ -26,7 +26,7 @@
 /* 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:

Modified: cfe/trunk/test/Parser/objc-foreach-error-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/objc-foreach-error-1.m?rev=65639&r1=65638&r2=65639&view=diff

==============================================================================
--- cfe/trunk/test/Parser/objc-foreach-error-1.m (original)
+++ cfe/trunk/test/Parser/objc-foreach-error-1.m Fri Feb 27 11:15:01 2009
@@ -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
 
 





More information about the cfe-commits mailing list