From 879fb1de5c8670e52d298bcbaa5278d4794fbe4e Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 26 Oct 1998 00:48:20 +0000 Subject: [PATCH] typeck.c (convert_arguments): Don't handle pmf references specially. * typeck.c (convert_arguments): Don't handle pmf references specially. * init.c (build_member_call): Don't try to convert to the base type if it's ambiguous. * typeck2.c (check_for_new_type): Don't depend on pedantic. From-SVN: r23338 --- gcc/cp/ChangeLog | 10 ++++++++++ gcc/cp/init.c | 7 +++++-- gcc/cp/typeck.c | 6 ------ gcc/cp/typeck2.c | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 69287e3c6fa..4a22f1ec2b7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +1998-10-26 Jason Merrill + + * typeck.c (convert_arguments): Don't handle pmf references + specially. + + * init.c (build_member_call): Don't try to convert to the base type + if it's ambiguous. + + * typeck2.c (check_for_new_type): Don't depend on pedantic. + 1998-10-25 Mark Mitchell * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 82e616f76cd..3b3ee7f6cc4 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1417,8 +1417,11 @@ build_member_call (type, name, parmlist) decl = maybe_dummy_object (type, &basetype_path); /* Convert 'this' to the specified type to disambiguate conversion - to the function's context. */ - if (decl == current_class_ref) + to the function's context. Apparently Standard C++ says that we + shouldn't do this. */ + if (decl == current_class_ref + && ! pedantic + && ACCESSIBLY_UNIQUELY_DERIVED_P (type, current_class_type)) { tree olddecl = current_class_ptr; tree oldtype = TREE_TYPE (TREE_TYPE (olddecl)); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 254bc394d3d..5030030af94 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3063,12 +3063,6 @@ convert_arguments (typelist, values, fndecl, flags) error ("insufficient type information in parameter list"); val = integer_zero_node; } - else if (TREE_CODE (val) == OFFSET_REF - && TREE_CODE (TREE_TYPE (val)) == METHOD_TYPE) - { - /* This is unclean. Should be handled elsewhere. */ - val = build_unary_op (ADDR_EXPR, val, 0); - } else if (TREE_CODE (val) == OFFSET_REF) val = resolve_offset_ref (val); diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 809b89d589e..8fa70c9fb96 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1659,6 +1659,6 @@ check_for_new_type (string, inptree) char *string; flagged_type_tree inptree; { - if (pedantic && inptree.new_type_flag) + if (inptree.new_type_flag) pedwarn ("ANSI C++ forbids defining types within %s",string); } -- 2.30.2