This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 114b. See for the official list.


2628. Implicit deduction guides should propagate constraints

Section:  [over.match.class.deduct]     Status: DRWP     Submitter: Roy Jacobson     Date: 2022-09-11

[Accepted as a DR at the November, 2023 meeting.]


template<class T> concept True = true;

template<class T> struct X {
  template<class U> requires True<T> X(T, U(&)[3]);
template<typename T, typename U> X(T, U(&)[3]) -> X<T>;
int arr3[3];
X z(3, arr3);     // #1

According to [over.match.class.deduct] bullet 1.1, the requires-clause of the constructor is not propagated to the function template synthesized for the implicit deduction guide. Thus, instead of favoring the more-constrained implicit deduction guide per [] bullet 2.6, the user-declared deduction-guide is preferred per [] bullet 2.11.

Proposed resolution (approved by CWG 2023-10-20):

Change in [over.match.class.deduct] bullet 1.1 as follows: