From: jakub Date: Fri, 20 Apr 2001 08:17:19 +0000 (+0000) Subject: * call.c (maybe_handle_ref_bind): Copy ICS_USER_FLAG and X-Git-Tag: upstream/4.9.2~94823 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23d29b52dba4fe271a6f3d6d9adade51d35b0e6c;p=platform%2Fupstream%2Flinaro-gcc.git * call.c (maybe_handle_ref_bind): Copy ICS_USER_FLAG and ICS_BAD_FLAG. * g++.old-deja/g++.other/overload14.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41448 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 24af2b4..16a03dc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2001-04-20 Jakub Jelinek + * call.c (maybe_handle_ref_bind): Copy ICS_USER_FLAG and + ICS_BAD_FLAG. + +2001-04-20 Jakub Jelinek + * search.c (lookup_field_r): If looking for type and non-TYPE_DECL is found, look first if name does not match the structure name. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 548bd00..4d4d033 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4741,11 +4741,14 @@ maybe_handle_ref_bind (ics, target_type) { if (TREE_CODE (*ics) == REF_BIND) { + tree old_ics = *ics; *target_type = TREE_TYPE (TREE_TYPE (*ics)); *ics = TREE_OPERAND (*ics, 0); + ICS_USER_FLAG (*ics) = ICS_USER_FLAG (old_ics); + ICS_BAD_FLAG (*ics) = ICS_BAD_FLAG (old_ics); return 1; } - + return 0; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1ceeb40..2a97b4e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2001-04-20 Jakub Jelinek + * g++.old-deja/g++.other/overload14.C: New test. + +2001-04-20 Jakub Jelinek + * g++.old-deja/g++.other/lookup23.C: New test. 2001-04-20 Jakub Jelinek diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload14.C b/gcc/testsuite/g++.old-deja/g++.other/overload14.C new file mode 100644 index 0000000..8938ef1 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/overload14.C @@ -0,0 +1,31 @@ +extern "C" void abort(); + +struct A { + typedef double (&B); + typedef const double (&C); + + A() { } + + operator C () const; + operator B (); +}; + +static const double d = 2.0; +static double e = 3.0; + +A::operator A::C () const +{ + abort (); + return d; +} + +A::operator A::B () +{ + return e; +} + +int main () +{ + (A::C) A (); // WARNING - + return 0; +}