From 535fb6eb200870e582a7f4abf2ea929cfc7e24c6 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 8 Jun 2011 17:34:54 -0400 Subject: [PATCH] semantics.c (potential_constant_expression_1): Handle destructor call. * semantics.c (potential_constant_expression_1): Handle destructor call. From-SVN: r174819 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/semantics.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f785c89..5675020 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-06-08 Jason Merrill + + * semantics.c (potential_constant_expression_1): Handle destructor + call. + 2011-06-08 Jakub Jelinek * cp-tree.h (struct tinst_level): Add chain_next GTY diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ebca840..53e5993 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -7763,6 +7763,12 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) want_rval = true; goto binary; + case BIT_NOT_EXPR: + /* A destructor. */ + if (TYPE_P (TREE_OPERAND (t, 0))) + return true; + /* else fall through. */ + case REALPART_EXPR: case IMAGPART_EXPR: case CONJ_EXPR: @@ -7771,7 +7777,6 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) case FLOAT_EXPR: case NEGATE_EXPR: case ABS_EXPR: - case BIT_NOT_EXPR: case TRUTH_NOT_EXPR: case FIXED_CONVERT_EXPR: case UNARY_PLUS_EXPR: -- 2.7.4