aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-06-09 23:55:41 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-06-09 23:55:41 -0400
commitb1623cc545933d93b4b34b3159d03554525f6e04 (patch)
treec9d2d664f61caec2d23396f62b24080dd7672546
parent8c53f5e2fad1a0c4bccd894ab6e57a169fc66baf (diff)
downloadgcc-b1623cc545933d93b4b34b3159d03554525f6e04.zip
gcc-b1623cc545933d93b4b34b3159d03554525f6e04.tar.gz
gcc-b1623cc545933d93b4b34b3159d03554525f6e04.tar.bz2
parser.c (cp_parser_constant_expression): Just return the non-constant expression.
* parser.c (cp_parser_constant_expression): Just return the non-constant expression. From-SVN: r174882
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/template7.C1
5 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c2ce6e0..4cff258 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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>
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 1d182a3..35f8957 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fa1fec8..54b17c2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C b/gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C
index 2094d3e..9942c58 100644
--- a/gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C
@@ -7,3 +7,5 @@ foo ()
const bool b =; // { dg-error "" }
foo < b > (); // { dg-error "constant expression" }
};
+
+// { dg-error "no match" "" { target *-*-* } 8 }
diff --git a/gcc/testsuite/g++.dg/parse/template7.C b/gcc/testsuite/g++.dg/parse/template7.C
index 0d3f3fa..d7dfef7 100644
--- a/gcc/testsuite/g++.dg/parse/template7.C
+++ b/gcc/testsuite/g++.dg/parse/template7.C
@@ -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 }