This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH Re: Problems compiling KDE programs with GCC 3.3+


In my earlier patch, I was forgetting that we can get an AMBIG_CONV for a
set of bad conversions, too.  Test in g++.dg/overload/ambig2.C.

Tested i686-pc-linux-gnu, applied 3.3 and trunk.

2003-01-13  Jason Merrill  <jason@redhat.com>

	* call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if
	all the ambiguous conversions are bad.

*** call.c.~1~	Fri Jan 10 00:55:48 2003
--- call.c	Sun Jan 12 23:01:26 2003
*************** build_user_type_conversion_1 (tree totyp
*** 2536,2543 ****
        cand = candidates;	/* any one will do */
        cand->second_conv = build1 (AMBIG_CONV, totype, expr);
        ICS_USER_FLAG (cand->second_conv) = 1;
!       /* Don't set ICS_BAD_FLAG; an ambiguous conversion is no worse than
! 	 another user-defined conversion.  */
  
        return cand;
      }
--- 2536,2546 ----
        cand = candidates;	/* any one will do */
        cand->second_conv = build1 (AMBIG_CONV, totype, expr);
        ICS_USER_FLAG (cand->second_conv) = 1;
!       if (!any_strictly_viable (candidates))
! 	ICS_BAD_FLAG (cand->second_conv) = 1;
!       /* If there are viable candidates, don't set ICS_BAD_FLAG; an
! 	 ambiguous conversion is no worse than another user-defined
! 	 conversion.  */
  
        return cand;
      }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]