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

2025-01-02


2982. Deduction in type-constraints

Section: 13.10.3.7  [temp.deduct.decl]     Status: open     Submitter: Richard Smith     Date: 2023-03-30

Consider:

  template<typename T, typename U> concept C = true;
  template<typename T> C<T> auto f() { return 0; }
  template C<int> auto f();

Is that valid? Or is the following needed:

  template C<int> auto f<int>();

The specification neither discusses deduction from a type-constraint nor treating it as a non-deduced context.

Possible resolution:

Change in 13.10.3.6 [temp.deduct.type] paragraph 5 as follows:

The non-deduced contexts are: