aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/call.c5
-rw-r--r--gcc/cp/typeck.c4
3 files changed, 12 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a8ed1ae..4f9c1d8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2004-11-24 Paolo Bonzini <bonzini@gnu.org>
+
+ PR c++/16882
+
+ * call.c (standard_conversion): Move check for conversions between
+ vector pointers...
+ * typeck.c (ptr_reasonably_similar): ... here.
+
2004-11-23 Ben Elliston <bje@au.ibm.com>
* cp-tree.h (context_as_string): Remove extern.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 613d0d4..c67b16f 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -652,11 +652,6 @@ standard_conversion (tree to, tree from, tree expr)
if ((tcode == POINTER_TYPE || TYPE_PTR_TO_MEMBER_P (to))
&& expr && null_ptr_cst_p (expr))
conv = build_conv (ck_std, to, conv);
- else if (tcode == POINTER_TYPE && fcode == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (to)) == VECTOR_TYPE
- && TREE_CODE (TREE_TYPE (from)) == VECTOR_TYPE
- && vector_types_convertible_p (TREE_TYPE (to), TREE_TYPE (from)))
- conv = build_conv (ck_std, to, conv);
else if ((tcode == INTEGER_TYPE && fcode == POINTER_TYPE)
|| (tcode == POINTER_TYPE && fcode == INTEGER_TYPE))
{
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 4caf051..60f03c9 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -6425,6 +6425,10 @@ ptr_reasonably_similar (tree to, tree from)
COMPARE_BASE | COMPARE_DERIVED))
continue;
+ if (TREE_CODE (to) == VECTOR_TYPE
+ && vector_types_convertible_p (to, from))
+ return 1;
+
if (TREE_CODE (to) == INTEGER_TYPE
&& TYPE_PRECISION (to) == TYPE_PRECISION (from))
return 1;