summaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>1996-07-19 21:46:24 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>1996-07-19 21:46:24 +0000
commit1d321d15836e007c324603149bc9337b04818563 (patch)
tree8c74e2ca959c3e405c52bda9123223639630aa9b /gcc/cp/init.c
parent276068675a7dacd0eab066f91cacb9f919c89eb6 (diff)
downloadgcc-1d321d15836e007c324603149bc9337b04818563.tar.gz
87th Cygnus<->FSF quick merge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12535 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 33f55df5882..862dca75a66 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -1530,21 +1530,20 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
return;
}
-#ifndef NEW_OVER
- /* See whether we can go through a type conversion operator.
- This wins over going through a non-existent constructor. If
- there is a constructor, it is ambiguous. */
- if (TREE_CODE (init) != TREE_LIST)
+ /* If this is copy-initialization, see whether we can go through a
+ type conversion operator. */
+ if (TREE_CODE (init) != TREE_LIST && (flags & LOOKUP_ONLYCONVERTING))
{
tree ttype = TREE_CODE (init_type) == REFERENCE_TYPE
? TREE_TYPE (init_type) : init_type;
if (ttype != type && IS_AGGR_TYPE (ttype))
{
- tree rval = build_type_conversion (CONVERT_EXPR, type, init, 0);
+ tree rval = build_type_conversion (CONVERT_EXPR, type, init, 1);
if (rval)
{
+#ifndef NEW_OVER
/* See if there is a constructor for``type'' that takes a
``ttype''-typed object. */
tree parms = build_tree_list (NULL_TREE, init);
@@ -1558,12 +1557,13 @@ expand_aggr_init_1 (binfo, true_exp, exp, init, alias_this, flags)
cp_error ("ambiguity between conversion to `%T' and constructor",
type);
else
+#endif
+ if (rval != error_mark_node)
expand_aggr_init_1 (binfo, true_exp, exp, rval, alias_this, flags);
return;
}
}
}
-#endif
}
/* We know that expand_default_init can handle everything we want
@@ -2022,7 +2022,8 @@ resolve_offset_ref (exp)
if ((TREE_CODE (member) == VAR_DECL
&& ! TYPE_PTRMEMFUNC_P (TREE_TYPE (member)))
- || TREE_CODE (TREE_TYPE (member)) == FUNCTION_TYPE)
+ || TREE_CODE (TREE_TYPE (member)) == FUNCTION_TYPE
+ || TREE_CODE (TREE_TYPE (member)) == METHOD_TYPE)
{
/* These were static members. */
if (mark_addressable (member) == 0)