aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-03-16 13:04:41 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-03-16 13:04:41 -0400
commit23d956f9358316e3a65455ff3dc4caffb6b67de3 (patch)
tree3fadba72eff30694e113412308e175ec50c69a8d /gcc
parentbb4586d38825faf532f8dd12c73049410563ee7c (diff)
downloadgcc-23d956f9358316e3a65455ff3dc4caffb6b67de3.zip
gcc-23d956f9358316e3a65455ff3dc4caffb6b67de3.tar.gz
gcc-23d956f9358316e3a65455ff3dc4caffb6b67de3.tar.bz2
parser.c (cp_parser_abort_tentative_parse): Make sure we haven't committed to this tentative parse.
* parser.c (cp_parser_abort_tentative_parse): Make sure we haven't committed to this tentative parse. From-SVN: r171054
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/parser.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ed5dcd8..8a40829 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index a9fd201..9523fdc 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -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. */