parser.c (cp_parser_constant_expression): Just return the non-constant expression.
authorJason Merrill <jason@redhat.com>
Fri, 10 Jun 2011 03:55:41 +0000 (23:55 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 10 Jun 2011 03:55:41 +0000 (23:55 -0400)
* parser.c (cp_parser_constant_expression): Just return the
non-constant expression.

From-SVN: r174882

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C
gcc/testsuite/g++.dg/parse/template7.C

index c2ce6e02fbed32928c08dca87a61994ee641a52f..4cff25833a7445d70b3595a0b630f6236721eb9d 100644 (file)
@@ -1,5 +1,8 @@
 2011-06-09  Jason Merrill  <jason@redhat.com>
 
+       * parser.c (cp_parser_constant_expression): Just return the
+       non-constant expression.
+
        * semantics.c (finish_compound_literal): Set TREE_HAS_CONSTRUCTOR.
 
 2011-06-09  Paolo Carlini  <paolo.carlini@oracle.com>
index 1d182a396b169bcb4141d20c71f8a5ed94d29789..35f8957aa65b6eb56f2169266bf9ccb1e9c51689 100644 (file)
@@ -7050,8 +7050,6 @@ cp_parser_constant_expression (cp_parser* parser,
     }
   if (allow_non_constant_p)
     *non_constant_p = parser->non_integral_constant_expression_p;
-  else if (parser->non_integral_constant_expression_p)
-    expression = error_mark_node;
   parser->non_integral_constant_expression_p
     = saved_non_integral_constant_expression_p;
 
index fa1fec8849f87c7630cd72dff261434c3a45874c..54b17c2e96435ba577baca60cbf61a20a2695ddb 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-09  Jason Merrill  <jason@redhat.com>
+
+       * g++.dg/cpp0x/regress/error-recovery1.C: Adjust.
+       * g++.dg/parse/template7.C: Adjust.
+
 2011-06-09  Kaz Kojima  <kkojima@gcc.gnu.org>
 
        PR target/49307
index 2094d3e3ebe110764c77553c5cb00cf54cd01fdd..9942c58ab1c20519a74193dad63f400f6fe4e272 100644 (file)
@@ -7,3 +7,5 @@ foo ()
   const bool b =;              // { dg-error "" }
   foo < b > ();                        // { dg-error "constant expression" }
 };
+
+// { dg-error "no match" "" { target *-*-* } 8 }
index 0d3f3fa24a1c27b70de671a4a02179b2e963512e..d7dfef7c11c02c997c21fbb59e270d6558a1c15f 100644 (file)
@@ -2,4 +2,3 @@ template <int I>
 void f();                      // { dg-message "note" }
 
 void g() { f<(3, 2)>(); } // { dg-error "" }
-// { dg-message "candidate" "candidate note" { target *-*-* } 4 }