summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-15 14:18:54 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-15 14:18:54 +0000
commitc3272a2d91fe6ea17fda647770cce468ca08bdec (patch)
treec7cbc23097a5a9ce5966a0a449022e2483987f57
parent714ac121e3a5bef0691d59f2785d2d41bed86c7c (diff)
downloadppe42-gcc-c3272a2d91fe6ea17fda647770cce468ca08bdec.tar.gz
ppe42-gcc-c3272a2d91fe6ea17fda647770cce468ca08bdec.zip
PR c++/63455
Revert: * parser.c (cp_parser_abort_tentative_parse): Make sure we haven't committed to this tentative parse. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@216261 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/testsuite/g++.dg/ext/stmtexpr16.C10
3 files changed, 17 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2cd0f1a2f77..582f231b41c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2014-10-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/63455
+ Revert:
+ * parser.c (cp_parser_abort_tentative_parse): Make sure we haven't
+ committed to this tentative parse.
+
2014-10-09 Jason Merrill <jason@redhat.com>
PR c++/63415
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index e6f94308acf..7893235afba 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -24982,8 +24982,6 @@ cp_parser_commit_to_topmost_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. */
diff --git a/gcc/testsuite/g++.dg/ext/stmtexpr16.C b/gcc/testsuite/g++.dg/ext/stmtexpr16.C
new file mode 100644
index 00000000000..ddce40c050d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/stmtexpr16.C
@@ -0,0 +1,10 @@
+// PR c++/63455
+// { dg-options "-std=gnu++11" }
+
+int main()
+{
+ int x = 0;
+
+ // without '+0', gcc 4.6 gives a different error (no ICE though)
+ decltype(({ int y = x; y; })+0) v1 = 0;
+}
OpenPOWER on IntegriCloud