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

2024-04-18


1486. Base-derived conversion in member pointer deduction

Section: 13.10.3.3  [temp.deduct.funcaddr]     Status: drafting     Submitter: John Spicer     Date: 2012-03-26

The rules for deducing template arguments when taking the address of a function template in 13.10.3.3 [temp.deduct.funcaddr] do not appear to allow for a base-to-derived conversion in a case like:

  struct Base {
    template<class U> void f(U);
  };

  struct Derived : Base { };

  int main() {
    void (Derived::*pmf)(int) = &Derived::f;
  }

Most implementations appear to allow this adjustment, however.