[cfe-dev] Goto requires ident

Neil Booth neil at daikokuya.co.uk
Sat Jul 21 20:39:18 PDT 2007


Found by my tests.  I'm assuming returning Res is OK, as it did before.

Neil.
-------------- next part --------------
Index: test/Parser/goto-ident.c
===================================================================
--- test/Parser/goto-ident.c	(revision 0)
+++ test/Parser/goto-ident.c	(revision 0)
@@ -0,0 +1,6 @@
+/* RUN: clang -parse-ast-check %s
+*/
+
+void foo() { 
+  goto ; /* expected-error {{expected identifier}} */
+}
Index: Parse/ParseStmt.cpp
===================================================================
--- Parse/ParseStmt.cpp	(revision 40380)
+++ Parse/ParseStmt.cpp	(working copy)
@@ -680,7 +680,10 @@
       return true;
     }
     Res = Actions.ParseIndirectGotoStmt(GotoLoc, StarLoc, R.Val);
+  } else {
+    Diag(Tok, diag::err_expected_ident);
   }
+    
   return Res;
 }
 


More information about the cfe-dev mailing list