aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-04-24 10:50:51 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-04-24 10:50:51 -0400
commitf8815f7a483ba1fa81d5d07b7a519cd3931fa701 (patch)
treeceb4a2a9cc95464e94bc445e9f4f95fbf7f00c20 /gcc
parent1c3f3851dd0fb0d145fd3982a13a5cac0672ed27 (diff)
downloadgcc-f8815f7a483ba1fa81d5d07b7a519cd3931fa701.zip
gcc-f8815f7a483ba1fa81d5d07b7a519cd3931fa701.tar.gz
gcc-f8815f7a483ba1fa81d5d07b7a519cd3931fa701.tar.bz2
constexpr.c (potential_constant_expression_1): Remove obsolete code.
* constexpr.c (potential_constant_expression_1) [MINUS_EXPR]: Remove obsolete code. [NE_EXPR]: Likewise. From-SVN: r222414
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/constexpr.c19
2 files changed, 6 insertions, 19 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a463f66..767094d4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 2990519..6465677 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -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;