]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/20563 (Infinite loop in diagnostic (and ice after error message))
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Wed, 8 Jun 2005 11:26:05 +0000 (11:26 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Wed, 8 Jun 2005 11:26:05 +0000 (11:26 +0000)
PR c++/20563
* parser.c (cp_parser_label_declaration): Deal with invalid/missing
identifiers.

* g++.dg/ext/label4.C: New test.

From-SVN: r100756

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog

index bd8c19605487dbc91634260e8f6510b77323fa4d..6853265500a2ca7561aba30172d44f9bab00f21a 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/20563
+       * parser.c (cp_parser_label_declaration): Deal with invalid/missing
+       identifiers.
+
 2005-06-03  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/21853
index fb0d1e3051304405e393cbadc43afe77bfbb60cf..8765ff10e69eec4514a81778af2317dab6f2ff0c 100644 (file)
@@ -13639,7 +13639,10 @@ cp_parser_label_declaration (cp_parser* parser)
 
       /* Look for an identifier.  */
       identifier = cp_parser_identifier (parser);
-      /* Declare it as a lobel.  */
+      /* If we failed, stop.  */
+      if (identifier == error_mark_node)
+       break;
+      /* Declare it as a label.  */
       finish_label_decl (identifier);
       /* If the next token is a `;', stop.  */
       if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
index ac6e72a4925bbcdfefaf033466e953e58b92c6c5..728824453a106f05c53fa0b54629f566c9054486 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/20563
+       * g++.dg/ext/label4.C: New test.
+
 2005-06-03  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/21853