]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/63455 (decltype of statement expression internal compiler error: in cp_par...
authorJason Merrill <jason@redhat.com>
Wed, 15 Oct 2014 16:46:35 +0000 (12:46 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 15 Oct 2014 16:46:35 +0000 (12:46 -0400)
PR c++/63455
Revert:
* parser.c (cp_parser_abort_tentative_parse): Make sure we haven't
committed to this tentative parse.

From-SVN: r216277

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/g++.dg/ext/stmtexpr16.C [new file with mode: 0644]

index 643b5cb74224e1ef67d624699f29819f5d72a6a7..917e5cfdd20cff7035af2016e8eeee32a6d4c441 100644 (file)
@@ -1,5 +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.
+
        PR c++/63415
        * pt.c (value_dependent_expression_p) [CONSTRUCTOR]: Check the type.
        (iterative_hash_template_arg): Likewise.
index affe2df0c4719282a4edaf5333cf0dedb0a98982..a84bc59cef2273de8d045468858f3382e84fdac5 100644 (file)
@@ -23779,8 +23779,6 @@ 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.  */
diff --git a/gcc/testsuite/g++.dg/ext/stmtexpr16.C b/gcc/testsuite/g++.dg/ext/stmtexpr16.C
new file mode 100644 (file)
index 0000000..ddce40c
--- /dev/null
@@ -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;
+}