From b1623cc545933d93b4b34b3159d03554525f6e04 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 9 Jun 2011 23:55:41 -0400 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/parser.c | 2 -- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/regress/error-recovery1.C | 2 ++ gcc/testsuite/g++.dg/parse/template7.C | 1 - 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c2ce6e02fbe..4cff25833a7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2011-06-09 Jason Merrill + * 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 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 1d182a396b1..35f8957aa65 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 fa1fec8849f..54b17c2e964 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-06-09 Jason Merrill + + * g++.dg/cpp0x/regress/error-recovery1.C: Adjust. + * g++.dg/parse/template7.C: Adjust. + 2011-06-09 Kaz Kojima 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 2094d3e3ebe..9942c58ab1c 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 0d3f3fa24a1..d7dfef7c11c 100644 --- a/gcc/testsuite/g++.dg/parse/template7.C +++ b/gcc/testsuite/g++.dg/parse/template7.C @@ -2,4 +2,3 @@ template void f(); // { dg-message "note" } void g() { f<(3, 2)>(); } // { dg-error "" } -// { dg-message "candidate" "candidate note" { target *-*-* } 4 } -- 2.30.2