From Jason Turner

[temp.deduct.type]

Diff to HTML by rtfpessoa

tmp/tmp0bq_c3l5/{from.md → to.md} RENAMED
@@ -43,10 +43,11 @@ specified, template argument deduction fails.
43
 
44
  The non-deduced contexts are:
45
 
46
  - The *nested-name-specifier* of a type that was specified using a
47
  *qualified-id*.
 
48
  - A non-type template argument or an array bound in which a
49
  subexpression references a template parameter.
50
  - A template parameter used in the parameter type of a function
51
  parameter that has a default argument that is being used in the call
52
  for which argument deduction is being done.
@@ -66,11 +67,11 @@ The non-deduced contexts are:
66
  ``` cpp
67
  template<class T> void g(T);
68
  g({1,2,3}); // error: no argument deduced for T
69
  ```
70
  - A function parameter pack that does not occur at the end of the
71
- *parameter-declaration-clause*.
72
 
73
  When a type name is specified in a way that includes a non-deduced
74
  context, all of the types that comprise that type name are also
75
  non-deduced. However, a compound type can include both deduced and
76
  non-deduced types. If a type is specified as `A<T>::B<T2>`, both `T` and
@@ -338,17 +339,14 @@ int x = deduce<77>(a.xm, 62, b.ym);
338
  // A<int>::X
339
  // i is explicitly specified to be 77, b.ym must be convertible
340
  // to B<77>::Y
341
  ```
342
 
343
- If, in the declaration of a function template with a non-type
344
- *template-parameter,* the non-type *template-parameter* is used in an
345
- expression in the function parameter-list and, if the corresponding
346
- *template-argument* is deduced, the *template-argument* type shall match
347
- the type of the *template-parameter* exactly, except that a
348
- *template-argument* deduced from an array bound may be of any integral
349
- type.[^8]
350
 
351
  ``` cpp
352
  template<int i> class A { /* ... */ };
353
  template<short s> void f(A<s>);
354
  void k1() {
 
43
 
44
  The non-deduced contexts are:
45
 
46
  - The *nested-name-specifier* of a type that was specified using a
47
  *qualified-id*.
48
+ - The *expression* of a *decltype-specifier*.
49
  - A non-type template argument or an array bound in which a
50
  subexpression references a template parameter.
51
  - A template parameter used in the parameter type of a function
52
  parameter that has a default argument that is being used in the call
53
  for which argument deduction is being done.
 
67
  ``` cpp
68
  template<class T> void g(T);
69
  g({1,2,3}); // error: no argument deduced for T
70
  ```
71
  - A function parameter pack that does not occur at the end of the
72
+ *parameter-declaration-list*.
73
 
74
  When a type name is specified in a way that includes a non-deduced
75
  context, all of the types that comprise that type name are also
76
  non-deduced. However, a compound type can include both deduced and
77
  non-deduced types. If a type is specified as `A<T>::B<T2>`, both `T` and
 
339
  // A<int>::X
340
  // i is explicitly specified to be 77, b.ym must be convertible
341
  // to B<77>::Y
342
  ```
343
 
344
+ If `P` has a form that contains `<i>`, and if the type of the
345
+ corresponding value of `A` differs from the type of `i`, deduction
346
+ fails. If `P` has a form that contains `[i]`, and if the type of `i` is
347
+ not an integral type, deduction fails.[^8]
 
 
 
348
 
349
  ``` cpp
350
  template<int i> class A { /* ... */ };
351
  template<short s> void f(A<s>);
352
  void k1() {