Skip to content

[dcl.fct.default] Overlapping specification of default template arguments #750

@t3nsor

Description

@t3nsor

Full name of submitter: Brian Bi

Issue description: [dcl.fct.default] and [temp.param] overlap, but should not, because the definition of "default argument" in p1 of the former section includes default template arguments for constant template parameters. The prohibition on default arguments for packs is redundantly specified in both. [dcl.fct.default]/5 and [temp.arg.nontype] could be read as simultaneously having application to default template arguments, or as the latter overriding the former. [dcl.fct.default] should be amended so that it clearly deals exclusively with default function arguments.

Suggested resolution: Edit [dcl.fct.default]/1 as shown:

If an initializer-clause is specified in a parameter-declaration other than a template-parameter ([temp.param]), this initializer-clause is used as a default argument. [Note 1: ...]

Edit [dcl.fct.default]/3 as shown:

A default argument shall be specified only in the parameter-declaration-clause of a function declaration or lambda-declarator or in a template-parameter ([temp.param]). A default argument shall not be specified for a template parameter pack or a function parameter pack. If it is specified in a parameter-declaration-clause, it A default argument shall not occur within a declarator or abstract-declarator of a parameter-declaration. [Footnote 77]

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