[...]
BTW, seems to no be no open issue for this; I'm going to submit one if
VC 2005 is still wrong.
Stefan
>VC 2003 calls f(char const*) for the following code
VS2005 B1 does the same.
Dave
Stefan Slapeta - 18 Mar 2005 13:09 GMT
>>VC 2003 calls f(char const*) for the following code
>
> VS2005 B1 does the same.
Thanks. I've entered Bug FDBK22888.
Stefan
> VC 2003 calls f(char const*) for the following code, but it should call
> the function template as f(char const*) is no perfect match (because of
> decay).
I think it's because of the qualification adjustment actually - decay
alone (a form of Lvalue Transformation) would mean that the two were
ambiguous apart from the second being a non-template, so that would win
(change to void f(char*) to see this effect on a conforming compiler).
See 13.3.3.2/3:
"S1 is a proper subsequence of S2 (comparing the conversion sequences in
the canonical form defined by 13.3.3.1.1, excluding any Lvalue
Transformation; the identity conversion sequence is considered to be a
subsequence of any non-identity conversion sequence)"
> Please could someone analyze the behaviour in VC .2005?
Pass, sorry about the unnecessary correction!
Tom
Stefan Slapeta - 21 Mar 2005 12:08 GMT
> I think it's because of the qualification adjustment actually - decay
> alone (a form of Lvalue Transformation) would mean that the two were
[quoted text clipped - 6 lines]
> Transformation; the identity conversion sequence is considered to be a
> subsequence of any non-identity conversion sequence)"
you are perfectly right - very interesting: if you replace char[] by
char*, the template is called! (that's what confused me when I wrote this).
Stefan