parser.c (cp_parser_abort_tentative_parse): Make sure we haven't committed to this...
authorJason Merrill <jason@redhat.com>
Wed, 16 Mar 2011 17:04:41 +0000 (13:04 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 16 Mar 2011 17:04:41 +0000 (13:04 -0400)
* parser.c (cp_parser_abort_tentative_parse): Make sure we haven't
committed to this tentative parse.

From-SVN: r171054

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

index ed5dcd85bda68f5aa6837159f7541275714f713e..8a4082941d932b65d9c5d430bd7152875e041f91 100644 (file)
@@ -1,5 +1,8 @@
 2011-03-16  Jason Merrill  <jason@redhat.com>
 
+       * parser.c (cp_parser_abort_tentative_parse): Make sure we haven't
+       committed to this tentative parse.
+
        PR c++/47999
        * semantics.c (finish_call_expr): Preserve reference semantics
        in templates.
index a9fd2010b253495aae40e551ae7904901d48ea27..9523fdccd950d8f8023068ae11de723e4f0b672a 100644 (file)
@@ -21398,6 +21398,8 @@ cp_parser_commit_to_tentative_parse (cp_parser* parser)
 static void
 cp_parser_abort_tentative_parse (cp_parser* parser)
 {
+  gcc_assert (parser->context->status != CP_PARSER_STATUS_KIND_COMMITTED
+             || errorcount > 0);
   cp_parser_simulate_error (parser);
   /* Now, pretend that we want to see if the construct was
      successfully parsed.  */