[cfe-commits] r40381 - in /cfe/trunk: Parse/ParseStmt.cpp test/Parser/goto-ident.c

Chris Lattner sabre at nondot.org
Sat Jul 21 21:13:34 PDT 2007


Author: lattner
Date: Sat Jul 21 23:13:33 2007
New Revision: 40381

URL: http://llvm.org/viewvc/llvm-project?rev=40381&view=rev
Log:
Catch goto's with a missing identifier, patch by Neil Booth.

Added:
    cfe/trunk/test/Parser/goto-ident.c
Modified:
    cfe/trunk/Parse/ParseStmt.cpp

Modified: cfe/trunk/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseStmt.cpp?rev=40381&r1=40380&r2=40381&view=diff

==============================================================================
--- cfe/trunk/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/Parse/ParseStmt.cpp Sat Jul 21 23:13:33 2007
@@ -680,7 +680,11 @@
       return true;
     }
     Res = Actions.ParseIndirectGotoStmt(GotoLoc, StarLoc, R.Val);
+  } else {
+    Diag(Tok, diag::err_expected_ident);
+    return true;
   }
+    
   return Res;
 }
 

Added: cfe/trunk/test/Parser/goto-ident.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/goto-ident.c?rev=40381&view=auto

==============================================================================
--- cfe/trunk/test/Parser/goto-ident.c (added)
+++ cfe/trunk/test/Parser/goto-ident.c Sat Jul 21 23:13:33 2007
@@ -0,0 +1,6 @@
+/* RUN: clang -parse-ast-check %s
+*/
+
+void foo() { 
+  goto ; /* expected-error {{expected identifier}} */
+}





More information about the cfe-commits mailing list