Skip to content

CWG3204 [expr.call] Simplify restrictions on arguments for ellipsis parameters #918

Description

@t3nsor

Full name of submitter: Brian Bi

Issue description: The following wording in [expr.call]/12 is an unnecessarily abstruse way of describing which arguments can be passed to an ellipsis:

[...] The lvalue-to-rvalue, array-to-pointer, and function-to-pointer standard conversions are performed on the argument expression. An argument that has type cv std​::​nullptr_t is converted to type void* ([conv.ptr]). After these conversions, if the argument does not have arithmetic, enumeration, pointer, pointer-to-member, or class type, the program is ill-formed. [...]

Prior to C++26, the only argument type that is not permitted is void. Since C++26, cv std::meta::info is also disallowed, but neither Clang nor GCC currently enforces this restriction and it is not clear whether it is intentionally disallowed.

Activity

  1. jensmaurer commented on Jun 25, 2026

    @jensmaurer
    Member
  2. changed the title [-][expr.call] Simplify restrictions on arguments for ellipsis parameters[/-] [+]CWG3204 [expr.call] Simplify restrictions on arguments for ellipsis parameters[/+] on Jun 25, 2026
  3. t3nsor commented on Jun 26, 2026

    @t3nsor
    Author

    There are no expressions of qualified void type.

    And now that I'm looking at this again, I think we should lift the restriction on std::meta::info. Using an ellipsis parameter to create the worst possible implicit conversion sequence in an overload set is a common technique, and saying that the call is ill-formed if the argument has type std::meta::info means the call is ill-formed even in an unevaluated context. Moreover, the restriction does not apply to (what used to be) consteval-only types other than std::meta::info. I think these considerations strongly suggest that the restriction was unintentional: it crept in simply because P2996 did not update [expr.call]/12.

  4. katzdm commented on Jun 26, 2026

    @katzdm

    Yeah, we certainly didn't mean to constrain info in this way. Another point for the strategy of, "If P2996 didn't update the paragraph, there's probably a bug."

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions