Title
Argument conversions to nondeduced parameter types
Status
c++11
Section
13.10.3.2 [temp.deduct.call]
Submitter
Daniel Krügler

Created on 2010-08-29.00:00:00 last changed 123 months ago

Messages

Date: 2011-03-15.00:00:00

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

Date: 2022-02-18.07:47:23

It is not clear whether the following example is well-formed or not:

    template<class T> struct identity { typedef T type; };

    template<class T, class C>
    void f(T C::*, typename identity<T>::type*){}

    struct X { void f() {}; };

    int main() { f(&X::f, 0); }

The null pointer conversion required for the second parameter of f is not one of the ones permitted by 13.10.3.2 [temp.deduct.call] paragraph 4, but it's unclear whether that list should apply to parameters with nondeduced types or not. 13.10.2 [temp.arg.explicit] paragraph 6 is explicit that

Implicit conversions (7.3 [conv]) will be performed on a function argument to convert it to the type of the corresponding function parameter if the parameter type contains no template-parameters that participate in template argument deduction.

However, this statement appears in a section dealing with explicitly-specified template arguments, so its applicability to nondeduced contexts in general is not clear.

Implementations disagree on the handling of this example.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3401
2011-04-10 00:00:00adminsetstatus: drafting -> fdis
2010-11-29 00:00:00adminsetstatus: open -> drafting
2010-08-29 00:00:00admincreate