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


526. Confusing aspects in the specification of non-deduced contexts

Section: 13.10.3.6  [temp.deduct.type]     Status: CD1     Submitter: Mike Miller     Date: 25 July 2005

[Voted into WP at the October, 2006 meeting.]

13.10.3.6 [temp.deduct.type] paragraph 5 reads:

The non-deduced contexts are:

There are two problems with this list:

  1. The last bullet is redundant with the second bullet. This appears to have been the result of applying the resolutions of issues 70 and 352 independently instead of in coordination.

  2. The second bullet appears to be contradicted by the statement in paragraph 8 saying that an argument can be deduced if P and A have the forms type[i] and template-name<i>.

    The intent of the wording in bullet 2 appears to have been that deduction cannot be done if the template parameter is a sub-expression of the template argument or array bound expression and that it can be done if it is the complete expression, but the current wording does not say that very clearly. (Similar wording also appears in 13.8.3.2 [temp.dep.type] paragraph 3 and 13.10.3.6 [temp.deduct.type] paragraph 14.)

Proposed resolution (October, 2005):

  1. Change 13.10.3.6 [temp.deduct.type] paragraph 5 as indicated:

  2. The non-deduced contexts are:

  3. Change 13.10.3.6 [temp.deduct.type] paragraph 14 as indicated:

  4. If, in the declaration of a function template with a non-type template parameter, the non-type template parameter is used in an expression a subexpression in the function parameter list, the expression is a non-deduced context as specified above...
  5. Change 13.8.3.2 [temp.dep.type] paragraph 3 as indicated:

  6. A template argument that is equivalent to a template parameter (i.e., has the same constant value or the same type as the template parameter) can be used in place of that template parameter in a reference to the current instantiation. In the case of a non-type template argument, the argument must have been given the value of the template parameter and not an expression involving that contains the template parameter as a subexpression...