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


1322. Function parameter type decay in templates

Section: 13.10.3  [temp.deduct]     Status: drafting     Submitter: Jason Merrill     Date: 2011-05-19

The discussion of issue 1001 seemed to have settled on the approach of doing the 9.3.4.6 [dcl.fct] transformations immediately to the function template declaration, so that the original form need not be remembered. However, the example in 13.10.3 [temp.deduct] paragraph 8 suggests otherwise:

  template <class T> int f(T[5]);
  int I = f<int>(0);
  int j = f<void>(0); // invalid array

One way that might be addressed would be to separate the concepts of the type of the template that participates in overload resolution and function matching from the type of the template that is the source for template argument substitution. (See also the example in paragraph 3 of the same section.)

Notes, January, 2012: