Skip to content

CWG2974 [temp.deduct.type] Missing non-deduced context for nested-name-specifier of qualified-id of a template #660

Description

@hubert-reinterpretcast

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

Reference (section label): temp.deduct.type

Link to reflector thread (if any): N/A

Issue description:
https://wg21.link/temp.deduct.type#5.1 has, as a non-deduced context,

This does not cover templates named using a qualified-id. There is implementation divergence:

template <template <typename> class>
struct B;

struct C {
  template <typename>
  struct Nested;
};

template <typename T>
void f(T *, B<T::template Nested> *);

void g(C *cp) {
  f(cp, 0);  // Clang rejects; `T::` in the declaration of `f` is not a non-deduced context
}

Online compiler link: https://godbolt.org/z/8sTvW7W94

Suggested resolution:
Modify https://wg21.link/temp.deduct.type#5.1:

  • The nested-name-specifier of a type or template that was specified using a qualified-id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions