This is the mail archive of the gcc-bugs@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]

[Bug c++/12536] Regression regarding partial ordering


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<typename A>
some_type<A> bar(A const& a, A const& = A())
(ii) template<typename R, typename A>
some_type<R> 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!


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