Skip to content

[temp.deduct.call] Unclear relationship among the notional template parameters introduced for an array parameter #883

@t3nsor

Description

@t3nsor

Full name of submitter: Brian Bi

Issue description: [temp.deduct.call]/1 specifies:

[...] If removing references and cv-qualifiers from P gives std::initializer_list<P'> or P'[N] for some P' and N and the argument is a non-empty initializer list ([dcl.init.list]), then deduction is performed instead for each element of the initializer list independently, taking P' as separate function template parameter types P'i and the ith initializer element as the corresponding argument. [...]

The presumed intent is all P'i for a given P' must either be successfully deduced and agree with each other, or be non-deduced contexts, and at least one must succeed. However, the wording does not clearly state this.

Suggested resolution: Edit [temp.deduct.call]/1 as follows:

[...] If removing references and cv-qualifiers from P gives std::initializer_list<P'> or P'[N] for some P' and N and the argument is a non-empty initializer list ([dcl.init.list]), then deduction is instead performed instead for each element of the initializer list independently, taking P' as separate function template parameter types P'i and the ith initializer element as the corresponding argumentas if each element of the initializer list were the argument for a separate parameter having type P'. [...]

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