A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/1184.html below:

CWG Issue 1184

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-08-11

1184. Argument conversions to nondeduced parameter typesSection: 13.10.3.2  [temp.deduct.call]     Status: C++11     Submitter: Daniel Krügler     Date: 2010-08-29

[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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4