constexpr.c (potential_constant_expression_1): Remove obsolete code.
authorJason Merrill <jason@redhat.com>
Fri, 24 Apr 2015 14:50:51 +0000 (10:50 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 24 Apr 2015 14:50:51 +0000 (10:50 -0400)
* constexpr.c (potential_constant_expression_1) [MINUS_EXPR]:
Remove obsolete code.
[NE_EXPR]: Likewise.

From-SVN: r222414

gcc/cp/ChangeLog
gcc/cp/constexpr.c

index a463f66c18e02a27ec4c4804094dfda0c3444463..767094d42ab6ec57aa6a34418aa2dd4ecfb3e7cb 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-24  Jason Merrill  <jason@redhat.com>
+
+       * constexpr.c (potential_constant_expression_1) [MINUS_EXPR]:
+       Remove obsolete code.
+       [NE_EXPR]: Likewise.
+
 2015-04-23  Jason Merrill  <jason@redhat.com>
 
        PR c++/65646
index 2990519b4bc0626266bc4c13cf1d3f9d40dc403f..6465677a95051bb336b9ec21f8649f745fb12fce 100644 (file)
@@ -4156,15 +4156,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
       }
 
     case MINUS_EXPR:
-      /* -- a subtraction where both operands are pointers.   */
-      if (TYPE_PTR_P (TREE_OPERAND (t, 0))
-          && TYPE_PTR_P (TREE_OPERAND (t, 1)))
-        {
-          if (flags & tf_error)
-            error ("difference of two pointer expressions is not "
-                   "a constant expression");
-          return false;
-        }
       want_rval = true;
       goto binary;
 
@@ -4174,16 +4165,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
     case GE_EXPR:
     case EQ_EXPR:
     case NE_EXPR:
-      /* -- a relational or equality operator where at least
-            one of the operands is a pointer.  */
-      if (TYPE_PTR_P (TREE_OPERAND (t, 0))
-          || TYPE_PTR_P (TREE_OPERAND (t, 1)))
-        {
-          if (flags & tf_error)
-            error ("pointer comparison expression is not a "
-                   "constant expression");
-          return false;
-        }
       want_rval = true;
       goto binary;