Skip to content

CWG1790 Ellipsis following function parameter pack #1374

Description

@jfbastien

Migrating from https://isocpp.org/files/papers/P1018R18.html#issues
CWG1790

Section: 9.3.4.6 [dcl.fct] Status: extension Submitter: Daryle Walker Date: 2013-10-01
Although the current wording permits an ellipsis to immediately follow a function parameter pack, it is not clear that the facilities permit access to the ellipsis arguments.

Rationale (June, 2014):

CWG felt that this is a question of language design and thus should be considered by EWG before any action.

Although the current wording permits an ellipsis to immediately follow a function parameter pack, it is not clear that the facilities permit access to the ellipsis arguments.

The problem here (which is not explained in the issue) is: how do you supply the name of the last parameter before the ellipsis to va_start? You can’t put the name of a pack there (it wouldn’t be expanded) and there’s no way to name the last element of the pack (nor to deal with the case where the pack is empty).

Meeting: (notes) 3 options: fix wording around “last parameter”, remove facility entirely (either va_start or function declarator), try to invent a language facility. JF emailed EWG to see if anyone has a strong preference, or if we should send back to CWG to fix wording, long discussion.

Michael Spertus: I am willing to commit to including and analysis on this in an upcoming paper on parameter packs.

JF followed up with Michael and Barry, no response.

Activity

  1. added this to the 2023-telecon milestone on Jan 25, 2023
  2. jensmaurer commented on Oct 24, 2023

    @jensmaurer
    Member

    C23 removes the requirement that the last parameter be named for va_start.

    All that remains is updating our specification of va_start to follow, which is handled by P2537 Relax va_start Requirements to Match C #1200.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EWGEvolution

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions