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 to joust


While browsing the core issues list, I noticed that the issue this hack
pertained to had been closed as Not a Defect; there are no longer builtin
candidates for ?: that take references.

Tested i686-pc-linux-gnu.

2001-11-26  Jason Merrill  <jason@redhat.com>

	* call.c (joust): Remove COND_EXPR hack.

*** call.c.~1~	Mon Nov 26 12:59:57 2001
--- call.c	Mon Nov 26 12:55:14 2001
*************** joust (cand1, cand2, warn)
*** 5405,5430 ****
  	    /* cand2 is built-in; prefer cand1.  */
  	    return 1;
  	}
- 
-       /* Kludge around broken overloading rules whereby
- 	 Integer a, b; test ? a : b; is ambiguous, since there's a builtin
- 	 that takes references and another that takes values.  */
-       if (cand1->fn == cand2->fn
- 	  && cand1->fn == ansi_opname (COND_EXPR))
- 	{
- 	  tree c1 = TREE_VEC_ELT (cand1->convs, 1);
- 	  tree c2 = TREE_VEC_ELT (cand2->convs, 1);
- 	  tree t1 = strip_top_quals (non_reference (TREE_TYPE (c1)));
- 	  tree t2 = strip_top_quals (non_reference (TREE_TYPE (c2)));
- 
- 	  if (same_type_p (t1, t2))
- 	    {
- 	      if (TREE_CODE (c1) == REF_BIND && TREE_CODE (c2) != REF_BIND)
- 		return 1;
- 	      if (TREE_CODE (c1) != REF_BIND && TREE_CODE (c2) == REF_BIND)
- 		return -1;
- 	    }
- 	}
      }
  
    /* If the two functions are the same (this can happen with declarations
--- 5405,5410 ----


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