aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2015-10-16 07:06:11 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2015-10-16 07:06:11 +0000
commit4856a1f0a1b91d2917ab09b08c55ff4fbf66f94e (patch)
treee5f9d064fd5537b6c392002aa14d733c7a665602 /gcc/cp/constexpr.c
parent08a7f38fab6d33c5ddcb86b217267e8864ee6839 (diff)
downloadgcc-4856a1f0a1b91d2917ab09b08c55ff4fbf66f94e.zip
gcc-4856a1f0a1b91d2917ab09b08c55ff4fbf66f94e.tar.gz
gcc-4856a1f0a1b91d2917ab09b08c55ff4fbf66f94e.tar.bz2
re PR c++/67926 (Using folding expressions in a constexpr context ice's)
/cp 2015-10-16 Paolo Carlini <paolo.carlini@oracle.com> PR c++/67926 * constexpr.c (potential_constant_expression_1): Handle UNARY_LEFT_FOLD_EXPR, UNARY_RIGHT_FOLD_EXPR, BINARY_LEFT_FOLD_EXPR, BINARY_RIGHT_FOLD_EXPR. /testsuite 2015-10-16 Paolo Carlini <paolo.carlini@oracle.com> PR c++/67926 * g++.dg/cpp1z/fold-ice1.C: New. From-SVN: r228861
Diffstat (limited to 'gcc/cp/constexpr.c')
-rw-r--r--gcc/cp/constexpr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index ec9710c..1bb8efa 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -4385,6 +4385,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
case TRUTH_NOT_EXPR:
case FIXED_CONVERT_EXPR:
case UNARY_PLUS_EXPR:
+ case UNARY_LEFT_FOLD_EXPR:
+ case UNARY_RIGHT_FOLD_EXPR:
unary:
return RECUR (TREE_OPERAND (t, 0), rval);
@@ -4565,6 +4567,8 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
case MEMBER_REF:
case DOTSTAR_EXPR:
case MEM_REF:
+ case BINARY_LEFT_FOLD_EXPR:
+ case BINARY_RIGHT_FOLD_EXPR:
binary:
for (i = 0; i < 2; ++i)
if (!RECUR (TREE_OPERAND (t, i), want_rval))