semantics.c (potential_constant_expression_1): Handle destructor call.
authorJason Merrill <jason@redhat.com>
Wed, 8 Jun 2011 21:34:54 +0000 (17:34 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 8 Jun 2011 21:34:54 +0000 (17:34 -0400)
* semantics.c (potential_constant_expression_1): Handle destructor
call.

From-SVN: r174819

gcc/cp/ChangeLog
gcc/cp/semantics.c

index f785c89e6107869ce51ad6b00d87eeb0927d1b42..5675020503fadd7af80d3d194f8930b68e001f14 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-08  Jason Merrill  <jason@redhat.com>
+
+       * semantics.c (potential_constant_expression_1): Handle destructor
+       call.
+
 2011-06-08  Jakub Jelinek  <jakub@redhat.com>
 
        * cp-tree.h (struct tinst_level): Add chain_next GTY
index ebca840ea2e466ac836f4eabb0ba1686c00ef26f..53e599305baa8d1be3431aecc92a730dd5452139 100644 (file)
@@ -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: