From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11722 invoked by alias); 31 Oct 2003 17:25:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 11706 invoked by uid 48); 31 Oct 2003 17:25:29 -0000 Date: Fri, 31 Oct 2003 17:30:00 -0000 Message-ID: <20031031172529.11705.qmail@sources.redhat.com> From: "nathan at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20031008065459.12536.jhr.walter@t-online.de> References: <20031008065459.12536.jhr.walter@t-online.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/12536] Regression regarding partial ordering X-Bugzilla-Reason: CC X-SW-Source: 2003-10/txt/msg02844.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12536 ------- Additional Comments From nathan at gcc dot gnu dot org 2003-10-31 17:25 ------- Actually, I beleive GCC is correct, but there is a DR about this somewhere. this one, I think http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#214 and #200 which points back to 214 Here is my reasoning. 2. Overloaded bar() (i) template some_type bar(A const& a, A const& = A()) (ii) template some_type bar(A const& a, R const& = R()) [14.5.5.2]/6 tells us that the presence of unused elliopsis and default arguments have no effect on the partial ordering of function templates. GCC takes that to mean that in partial ordering we only consider the actual parameters explicitly specified. Also partial ordering does not consider any explicitly specified template arguments. what happens is that we can take (i) and deduce against (ii), ut in deducing in the other direction we cannot deduce a type for the first template parameter (R). so (ii) is more specialized than (i). #214 will allow the undeduce R, as is given an explicit arg, and is not being used for partial ordering. Doing so will make deduction work in both directions and hence make the ordering ambiguous. So all the compilers a wrong!