Skip to content

CWG2664 [over.match.class.deduct] CTAD for alias template wording doesn't match design intent #190

@cmeerw

Description

@cmeerw

Full name of submitter (unless configured in github; will be published with the issue): Christof Meerwald

Reference (section label): over.match.class.deduct

Link to reflector thread (if any): Somewhat surprising CTAD for alias template behaviour

Issue description: [over.match.class.deduct]/3 only has an exception for deduction failure for non-deduced contexts when deducing the return type from the defining-type-id, but not for other cases where deduction fails according to [temp.deduct.type]/2, e.g.

  template <class S1, class S2> struct C {
    C(...);
  };

  template<class T1> C(T1) -> C<T1, T1>;
  template<class T1, class T2> C(T1, T2) -> C<T1 *, T2>;

  template<class V1, class V2> using A = C<V1, V2>;

resulting in A having neither of these deduction guides.

Suggested resolution: see Re: Somewhat surprising CTAD for alias template behaviour

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions