Created on 2010-08-29.00:00:00 last changed 130 months ago
[Voted into the WP at the March, 2011 meeting as part of paper N3262.]
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:00 | admin | set | status: fdis -> c++11 |
2011-04-10 00:00:00 | admin | set | messages: + msg3401 |
2011-04-10 00:00:00 | admin | set | status: drafting -> fdis |
2010-11-29 00:00:00 | admin | set | status: open -> drafting |
2010-08-29 00:00:00 | admin | create |