Skip to content

CWG2942 [dcl.fct] packs in parameter-type-list #629

@cor3ntin

Description

@cor3ntin

in decl.fct p4, we say

After producing the list of parameter types, any top-level cv-qualifiers modifying a parameter type are deleted when forming the function type. The resulting list of transformed parameter types and the presence or absence of the ellipsis or a function parameter pack is the function's parameter-type-list.

Emphasis mine.

It's not clear what we mean by "or a function parameter pack".
A function can have a number of parameter packs in arbitrary position, and the fact that only the trailing pack is a deduced context is irrelevant when we are not deducing anything.

Are these functions equivalent?

void f(auto..., auto) {}
void f(auto..., auto) {}

Proposed resolution (which needs further massaging)

After producing the list of parameter types, any top-level cv-qualifiers modifying a parameter type are deleted when forming the function type. The resulting list of transformed parameter types and whether each corresponding parameter-declaration is a function parameter pack and the presence or absence of the ellipsis or a function parameter pack is the function's parameter-type-list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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