diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-20 22:16:19 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-20 22:16:19 +0000 |
commit | 625e59f4620f41d79038adfc09c17a76f09eee0d (patch) | |
tree | 97855a7b72d0f3ae8bf475d1291d62c8ad50b81b /gcc/cp/call.c | |
parent | 759736d9afdd6a41e74793ae1bed67cd4587ca1f (diff) | |
download | gcc-625e59f4620f41d79038adfc09c17a76f09eee0d.tar.gz |
PR c++/34111
* call.c (standard_conversion): Derived-to-base is considered a
standard conversion.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131107 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index d240b85b03a..f15550d7fda 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -861,14 +861,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p, else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE && vector_types_convertible_p (from, to, false)) return build_conv (ck_std, to, conv); - /* A derived-to-base conversion sequence is a user-defined conversion - because it involves a constructor call, even though it has the rank of - a standard conversion, so we don't consider it if we aren't allowing - user-defined conversions. But if we're binding directly to a - reference, it's only a pointer conversion. */ - else if ((!(flags & LOOKUP_NO_CONVERSION) - || (flags & LOOKUP_NO_TEMP_BIND)) - && IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from) + else if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from) && is_properly_derived_from (from, to)) { if (conv->kind == ck_rvalue) |