This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15674] template argument binding differs between member and static fumctions
- From: "nathan at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 May 2004 09:42:33 -0000
- Subject: [Bug c++/15674] template argument binding differs between member and static fumctions
- References: <20040527071518.15674.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From nathan at gcc dot gnu dot org 2004-05-27 09:42 -------
This is a partial overload DR fix. John Spicer scripted DR 214 to cover
some aspects of it. One thing he didn't fix was the ordering between
Foo (T *) and Foo (T (&)[I]). Both deduce for an array, the former
because array->pointer decay happens before deduction when the template
argument is not a reference.
The partial ordering rules do not have that in them, so the two candidates
fail to deduce against eachother and hence are unordered.
I argue that because array->pointer decay happens at deduction, it should also
happen (when one is a ref and the other is not) at partial ordering. That is
what I implemented in GCC when going through an early draft of 214, and
talking to John (we needed to do something, because the std was broken).
Indeed some of my own code required this partial ordering to not be ambiguous.
That the member and nonmember case behave differently is a bug in GCC.
We need to implement DR214 plus the array->pointer ordering tweak and lobby
the core committee. It is useful to gather user input from the field as to why
this case should be ordered.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-05-27 09:42:32
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15674