Title
Unexpanded parameter packs don't make a function type dependent
Status
cd6
Section
13.8.3.2 [temp.dep.type]
Submitter
Richard Smith

Created on 2020-07-28.00:00:00 last changed 28 months ago

Messages

Date: 2020-08-15.00:00:00

Proposed resolution (August, 2020):

Change 13.8.3.2 [temp.dep.type] paragraph 9 as follows:

A type is dependent if it is

  • ...

  • an array type whose element type is dependent or whose bound (if any) is value-dependent,

  • a function type whose parameters include one or more function parameter packs,

  • a function type whose exception specification is value-dependent,

  • ...

(We do have the relevant wording for pack expansions in simple-template-ids in bullet 9.8, so that similar case is already handled.)

Date: 2020-11-15.00:00:00

[Accepted at the November, 2020 meeting.]

Consider the following example:

  template<typename ...T> auto f() {
    using F = int(*)(int (...p)[sizeof(sizeof(T))]);
    // ...
  }

F is not covered in the list of cases in 13.8.3.2 [temp.dep.type] paragraph 9, because the types from which the function type is constructed are not dependent types. (The parameter pack p is of type int[sizeof(size_t)].) Similar situations arise with non-injective alias templates.

History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: drwp -> cd6
2021-02-24 00:00:00adminsetstatus: dr -> drwp
2020-12-15 00:00:00adminsetmessages: + msg6332
2020-07-28 00:00:00admincreate